Skip to content


What is git?

git is a piece of version control software (VCS) like Subversion, CVS, or that Microsoft product (Team Foundation Server), except better.  Flat out, better.  There’s five things that make it so:

  1. Decentralized.  This means that if for some reason something happened to the master server, it’s not the end of the world: the whole thing can just be rebuilt.
  2. Because it’s decentralized, every user has every revision (that was committed to the master that they got their copy of the code from).  This means that if you need to do a diff, blame, revert, etc, it happens almost immediately, instead of having to go out to the master, talk a bit, do some data transfer, etc.  This also means, and here’s something really awesome:
  3. You can do everything you could in any other VCS offline (except for updating the master).
  4. It’s really easy to manage ACL’s.  I’ll get more into this a bit later, but here’s a taste: you can use standard ‘nix users and groups to manage access to parts of your repositories.
  5. You can commit without worry.  What I mean by this, is say your working on something, and you want to make an intermediate commit.  You know your code isn’t going to compile, or just plain break everything, but it doesn’t matter, because since a regular commit is just to your local repository, you can’t screw everyone else over.

Isn’t that cool?  Awesome even?  Possibly the best VCS ever?  Well, that might be going a little far; I’m sure someone at some point will think of something even better, but it really is pretty sweet.

Now, this does potentially make things a little confusing however, if your comming from Subversion, etc, because your used to things more being like a chat room, where everyone sees everything, and everyone only gets what’s going on when they’re in the room.  But trust me, it’s easy as cake.  Like, Hostess cake.  You know, the kind that’s already made, all you have to do is unwrap it, stuff it in your mouth, and swallow (no chewing required).  Some questions you might have after all this:

  • Q: How do I make my commit(s) available for everyone? A: You push your changes.  See basic commands below.
  • Q: What’s this about the ACL’s? A: Well, you have options.  You can set up everyone that can commit with SSH access (passwords or keys, or keys with passwords if you’re really secure!), or you can use this sweet thing called gitosis, that handles a lot of the security for you.  See http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way
  • Q: How different is it from Subversion, CVS, etc? A: Well, I’ve used SVN extensively, CVS a little bit, and the rest, none at all, but I’ll say once I figured out everything I’ve mentioned so far, it was in some ways easier than both of those, but all in all about the same to use, just FASTER!

And, as promised, here’s some common commands, in a sweet little comparison table thing.

git commands for the un-initiated

Do What? git svn cvs
Get help git help svn help cvs help
Checkout a repository git clone svn checkout cvs checkout
Get a status check git status svn status cvs status
Add a new file git add svn add cvs add
Commit changes to the master git push svn commit cvs commit
Getting updates from the master git pull --rebase svn update cvs update
Reverting a change git checkout svn revert cvs update
Resolving conflicts git merge svn resolved  
Adding a modified file to be committed git add    

Be Sociable, Share!

Posted in Version Control. Tagged with .

One Response

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

Continuing the Discussion

  1. Setting up git securely and easily using gitosis – four-bits.com linked to this post on August 20, 2009

    [...] mentioned in the earlier article on git (What is git?), git uses Linux user accounts to controll access to the repository. But, what if you want to be a [...]