Git on that train
Warning: As the title suggests, I’m on a train.
In the last week and a half or so I’ve been using Git for a project amongst coworkers and most recently for my own code and text files. I was a bit skeptical. But after going through their excellent documentation, seeing the videos, and most importantly, a lot of tinkering, I’m realizing that it’s making life better for me.
There are a lot of resources that compare SCMs, so I don’t want to worry here about which is better and why. But I’d like to share two things that I’ve really liked about using Git.
- First off, using something like Git doesn’t necessarily have to be for a big collaborative project. This may be a sort of different take than the usual, but I like to see it as a tool that helps me see different “views” of my files depending on the job. Anyone who’s written a lot of text or code realizes that it’s actually quite hard to make things as modular as one would like and that sometimes we’re relegated to grabbing snippets of text here and there rather than making black boxes. While this is not encouraged as an engineering practice, it’s sometimes very useful for play. With Git, I’m less concerned about making all my source code fit in a super-consistent modular framework and more concerned with focusing on doing a task cleanly. This is possible because I can branch and merge with relative ease (which I understand is a pain in the ass with other SCMs). In a branch I can move some files around and do whatever I want without affecting the source. I can then cherry-pick commits I like from that into another branch. These branches can look wholly different, but the code can still be updated. This flexibility makes me worry less about organization and directory structure and more about just choosing the right, minimalistic view for the job. I now see things in terms of diffs and commits and Git provides the machinery to do real work with them.
- Git is minimalistic, local, and fast. Which is great. It’s a small source code base that compiles quickly and gives me handy command line utilities. Proper use of them = power (though even with good documentation there’s a learning curve involved). Unlike a lot of SCMs, Git is designed to be local. While it can do a lot of stuff over the network, it’s modus operandi is in a local repository (which is just one .git/ directory in your root directory). I, in fact, don’t even use the SSH/SSL features layered on top. Git helps me realize what I’ve changed and worked on and I build patches from there. You can email them to whoever, and applying them is easy.
And if I’m frustrated with some apparent inadequacy, it’s likely I can find some post with Linus himself justifying it with a little intellegence (e.g.).