Hopefully a quick and easy question...
I have some code developed for a website on a test (Linux) box, which I'll call TestServer. A colleague has a copy, mostly in sync (manually), on his Windows desktop, ("WindowsDesktop"). Both of these are in my office behind my office firewall.
I need to get the code onto a Linux box located in another office ("RemoteServer") in such a way as to allow me to make changes anywhere and manage the synchronisation, so I plan on setting up a git repository on my external server ("HostedServer"), and pull the site from (and push back changes to) it from RemoteServer.
Of-course my starting point is that all of this has been done so far without any version control or other synchronisation. So, are there any pitfalls I should be aware of if I now try to get everything into git? Should I at least try to get everything synchronised in one location first? (I'd rather not, as I'd prefer to use git to manage that sync.)
Are there any issues I need to be aware of given that one person will be using a Windows box? (I'm assuming they'll use TortoiseGit; I'll probably set things up on my Windows laptop too.)
I've asked questions about git here here before and played around with it but still not used it in anger, but now I have someone I need to share development with I'm determined to finally get it together and use git properly. I don't want to ruin that ambition and fall flat by starting out wrong!
Secondary issue: the sites make extensive use of a database. I should at least make attempts to ensure that the database schema is managed by git (but not the data in the database). Any suggestions as to how best to do this?
Mark Rogers
Hi,
On 19 February 2011 21:01, Mark Rogers mark@quarella.co.uk wrote:
Hopefully a quick and easy question...
There's never such a thing ;)
I have some code developed for a website on a test (Linux) box, which I'll call TestServer. A colleague has a copy, mostly in sync (manually), on his
In sync with what?
I need to get the code onto a Linux box located in another office ("RemoteServer") in such a way as to allow me to make changes anywhere and manage the synchronisation, so I plan on setting up a git repository on my external server ("HostedServer"), and pull the site from (and push back changes to) it from RemoteServer.
Be prepared for strange and confusing conflict messages ;)
Of-course my starting point is that all of this has been done so far without any version control or other synchronisation. So, are there any pitfalls I should be aware of if I now try to get everything into git? Should I at
One pitfall is that you will not actually have any change history from previous versions, but I gather that you realised this already. Also be prepared for a learning curve.
least try to get everything synchronised in one location first? (I'd rather not, as I'd prefer to use git to manage that sync.)
Well, at one point, you will have to initialise a git repository. You'd need to do this at the start. (I'm not 100% sure, but it seems to me not possible to have two separately initialised git repositories that end up merged, though I do believe a commit can have two parents when merging. Thus it might be possible to fuse 2 unrelated trees together. Anyone that has an answer, please let me know! :-) )
Are there any issues I need to be aware of given that one person will be using a Windows box? (I'm assuming they'll use TortoiseGit; I'll probably set things up on my Windows laptop too.)
Git Extensions is a pretty good tool. Get it at: http://sourceforge.net/projects/gitextensions/ It is quite possible that at times they will still need to go to the command line.
Secondary issue: the sites make extensive use of a database. I should at least make attempts to ensure that the database schema is managed by git (but not the data in the database). Any suggestions as to how best to do this?
Just add the schema as a file in your git repository (and it should be fine if it's ASCII, though binary files are also handled OK).
Resources that could be useful:
-- http://book.git-scm.com/index.html
-- "Pro Git" by Scott Chacon (book, look on Amazon)
-- http://stackoverflow.com/questions/tagged/git
Regards, Srdjan
On 19/02/11 21:20, Srdjan Todorovic wrote:
Hopefully a quick and easy question...
There's never such a thing ;)
So true!
I have some code developed for a website on a test (Linux) box, which I'll call TestServer. A colleague has a copy, mostly in sync (manually), on his
In sync with what?
In sync with TestServer, ie manually copying files between two machines until both have the latest of everything (the sort of thing that version control would automate).
One pitfall is that you will not actually have any change history from previous versions, but I gather that you realised this already. Also be prepared for a learning curve.
There is no change history to maintain, I want to get to a point where it starts to be tracked from now on though.
Well, at one point, you will have to initialise a git repository. You'd need to do this at the start. (I'm not 100% sure, but it seems to me not possible to have two separately initialised git repositories that end up merged, though I do believe a commit can have two parents when merging. Thus it might be possible to fuse 2 unrelated trees together. Anyone that has an answer, please let me know! :-) )
Seems to me that I should manually sync both machines that have the code now and get to the point that I am happy that TestServer contains the "master" copy of the code. Then get that committed, and start from there.
Git Extensions is a pretty good tool. Get it at: http://sourceforge.net/projects/gitextensions/ It is quite possible that at times they will still need to go to the command line.
They're not command-line shy, and sooner or later they'll need to be comfortable on Linux anyway, but then I also have a Win7 laptop that I would like to be able to access the code from.
Just add the schema as a file in your git repository (and it should be fine if it's ASCII, though binary files are also handled OK).
The problem with tracking the schema is that I still have to sync changes with the database (ie schema changes, how do I change the DB to the new schema without losing existing data?)
I imagine there's a MySQL logging option somewhere that would allow me to capture all CREATE/ALTER/DROP TABLE commands and log them to a file that I add to my repository, whilst keeping a copy of the schema too for "new" installs. That should work, need to play.
Resources that could be useful:
-- http://book.git-scm.com/index.html -- "Pro Git" by Scott Chacon (book, look on Amazon) -- http://stackoverflow.com/questions/tagged/git
Thanks, I'll go exploring. I got a Kindle from the wife on Valentine's Day so I can pull lots of resources onto that and read them without it looking like I'm "working" :-)