On Fri, Nov 18, 2011 at 07:11, PJ Weisberg <p...@irregularexpressions.net> 
> I'm looking for something in Git analogous to the revision numbers in
> Subversion.  Pretty much exactly what you get from `git describe', but
> I don't want it to be dependent on any tags or refs.  Is there any way
> to get something like that out of Git?

You really should use SHA-1 references if you want to refer to some
point in history and you don't want to use tags. However, if you want
something similar to subversion revision numbers, this should get
pretty close to subversion semantics:

    echo r$(git log --date-order --oneline --all | wc -l)

Example output is "r1090".

Drop the "--all" flag if you want revision number for the current branch only.

However, there is not an easy way to map from such revision number
back to corresponding history revision. Git uses SHA-1 references for
a reason.

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to