I come from RCS, where revision numbers are easy to insert into files with RCS keyword strings such as $Revision: $
, $Id: $
and $Header: $
.
There are various posts around of different ways of using revision numbers in Git, e.g. http://stackoverflow.com/questions/4120001/what-is-the-git-equivalent-for-revision-number
When using tags to record release revision numbers, we can use git describe
to obtain reasonable-looking revision numbers, e.g. 1.2.1-2-g17880f1
, where 1.2.1
is the most recent tag on the current branch, 2
is the number of commits made since the tag, and 17880f1
is the (short) SHA of the current commit (prefixed with g
for "git"). These numbers have the benefit of monotonically increasing in the -<number-of-commits>-
part, and presumably you would use some sort of meaningful release revision numbers in tags, so they should be fairly easy to understandy by non-technical people (ignoring the -g<SHA>
at the end).