Git, one month on
I've been using Git for about a month now. Overall, everyone has been right about it -- it's got some heinous usability problems, but man is it kick ass to have distributed version control.
For instance, I've taken a few trips since I switch to Git, and I've committed on an airplane at least twice now. This seems like a small thing, in that I could always wait to commit, but I'm often surprisingly productive in planes, and there are plenty of things you can't actually recover from in SVN without the full repository (e.g., moving directories around).
The cool things about Git don't all require its distributed aspect -- for instance, its branching is far superior ot SVN's (if you could say SVN even has branching). I found myself three commits into some work last week that really should have been a separate branch. With Git, this was really easy to do -- I branched from the current state, then rewound the current branch to remove the commits I didn't want in it.
I was in a branch named indirection, and I decided it made sense to make a new branch named configurations.
Using the git reset man page, this is what I did:
$ git branch configurations $ git reset --hard HEAD~3 $ git checkout configurations
This left me in the new branch I wanted and left the indirections branch in the state it was at before I made the big changes.
It's clearly not all peaches and cream, though. As I mentioned, there are definite usability issues. It's not so much that you can't figure it but that it's just seldom what you expect. It doesn't help that the majority of the examples are from Linus's life, and his life is far more complicated than most, in terms of managing repositories.
The mechanism for pulling, fetching, and pushing branches is especially counterintuitive.
Overall, though, I'm very happy with it.
Sun, 23 Sep 2007 | Tags: tools, git, scm, dscm, svn, cvs
This is slightly off on how it should['ve] been done. you created a new branch but did NOT change to it, then reset (you should always be /extremely/ careful with --hard), then finally checked out your new branch. this reset indirection to HEAD~3 (cause it was your checked out branch) and kept configurations at HEAD. either of the following would have worked properly:
git branch configurations HEAD~3 ; git checkout configurations
git checkout -b configurations HEAD~3
and i will agree, git is a more to wrap your brain around than say svn, but it is well worth it ;)