Some of my thoughts on Git

Git is the version control system I am using now. I find it useful for my needs in particular since I do at least a part of my work on locations that don’t have network access. Git uses a federated model – you have all the repository history, and you can commit even while you’re not connected.

If this sounds attractive to you, read on to see how you can use git as the sandbox for your svn repository and to learn about the features of git.

The basics of Git

In git, every change is a simple delta of multiple files with a SHA1 string as its name, so that it can be uniquely identified across branches, and a branch is just a list of SHA1s that make up that branch. In a sense, the SHA1 deltas themselves can be thought of as a mini-branch, which means that merging is a lot more common. But don’t fret, git is a lot smarter about merging than most content tracking systems.

Git does not track “files”. It instead tracks “blobs”, which is partial file data. Ignore files and folders work mostly as you would expect, except empty folders are not tracked.

Git also tracks “remote” sets of deltas and remote branches, which are, like a local branch, a collection of deltas. Finally, it can track the deltas that have been uploaded to the server in a particular remote branch versus the ones that are just local to your machine.

What Git makes possible

These basic building blocks allow git to be a very powerful content tracking system, in particular because it allows you to commit several times (maybe for weeks) into your local repository until your feature works perfectly, and only then submit all your commits to the server. Because it lower the barrier of effort in creating a branch (cheap, atomic and no server required), it allows you to manage your work in “feature branches”.

How do I get it

On Mac OS X, use MacPorts. On Windows, you can use Cygwin. On Linux a simple rpm or apt install should do it.

Some Useful Git Tools

OS X Specific

How can I learn how to use it

The Git Manual is a great start. There is also a pretty good two-part tutorial by Bart Trojanowski. If you like learning using books instead, Pragmatic Version Control Using Git by Travis Swicegood is pretty good.

1 thought on “Some of my thoughts on Git”

Comments are closed.