Git LogoMy biggest out-of-the-box Git complaint is that it uses SHA1 hashes to identify each commit.  Technically this makes a lot of sense, but from a human readability standpoint it sucks.  And by looking at two commit hashes, you don’t know how many commits were in between them.

So, here’s the methodology I use to keep track of commit numbers and get a little bit of version numbering out of the deal.

  1. Initialize your Git repository using
    git init
  2. Put a file (or your project or whatever) in there and do your first commit
    git add *
    git commit -m "First Commit"
  3. Tag it using
    git tag -a -m "Version 0.1" vo.1 HEAD
  4. Check your commit count using
    git describe

A sample output from a project I’m working on (tagged to v0.8 when the repository was created):


The 128 is the commit count, so I would refer to this as version 0.8.128 when referencing it verbally/via email.