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" :-)