Git has no concept of "Revision Number". It has a commit hash. You won’t know your commit hash until you actually made a mistake, so you won’t be able to get the “current hash”.
If you need a commit hash of a previous commit, use git log -1
. If you only need hash output, then xpapad's answer is what you are looking for.
If you mean the actual version of Git (your question was a bit ambiguous for me), use git version
.
vcsjones
source share