Converting to git

drhyde on 2009-03-07T20:40:10

I wanted to be abe to commit to my CVS repository while I was offline - eg while using my laptop on a train. But CVS doesn't support that, and to make it pretend to support it would involve some quite monstrous hacks. Of the commonly used VCSes, only git supports offline commits, so I decided to try that instead. There are some excellent instructions here which mostly Just Work.

Mostly.

There are two small flaws. First, it died importing this file. I couldn't be bothered to analyse why, and just deleted it and its history from the local copy I'd made of the repository (I used rsync to suck it down from Sourceforge). Contrary to the documentation, 'git cvsimport' does not carry on where it left off if it gets interrupted half way through, so once I'd deleted the offending file I had to also delete the broken git repo and start again. Once it had finished I then added the most recent version of the file to the git repo in the usual way. So I lost the history of that file. Thankfully it doesn't matter in this case.

The second flaw is a minor one. It tells you to delete the repo's contents leaving just the .git directory, thus making it a "bare" repository. But it doesn't tell you that you have to edit .git/config and set the "bare" variable to true. If you don't do that, you'll get spurious warnings when you do a 'git push'.

First impressions of using git as "CVS with offline commits" are good. It works very well for a single user editing code in various different places throughout the day. I have yet to experiment with multiple concurrent edits. While I'm sure it works well if you use git in a distributed fashion, I still don't quite trust it to work in a similar fashion to CVS, with multiple users pushing changes to a central repository. But if I have any problems, you can be sure I'll grumble here about them.


Git is not the only game in town...

revdiablo on 2009-03-08T18:24:56

I guess it hinges on what you consider "commonly used", but there are quite a few VCSes that do offline commits. There's a whole bunch of 'em, in fact. It's a pretty exciting new branch (excuse the pun) in the VCS world, so I'm happy to see new people trying any of them, but Git is certainly not the only one.

My personal favorite is Mercurial, you can see a big list of them on Wikipedia: http://en.wikipedia.org/wiki/List_of_revision_control_software#Distributed_model

Re:Git is not the only game in town...

perigrin on 2009-03-10T19:30:43

In fact one could argue that SVK allows Subversion to do offline commits ... and Subversion has to be in any list of "commonly used VCSes".