If I may reformulate your question: how can I include revision information
in my build?
As far as I can remember, in SVN some did it differently by having a
keywords in files that would be replaced during commit (a similar question
is discussed here on
Now I'm a bit unsure what you want, but I'll assume you want to know the
HEAD revision of the repo of which you are building, and put this into some
It is usually the job of the build-tool to fetch and include this
information. So somewhere in your build-script, you need to do something
$ echo "Timestamp: "`date` >> version.txt
$ echo "Revision: "`git rev-parse HEAD` >> version.txt
$ echo "Tag: "`git name-rev --tags --name-only HEAD` >> version.txt
The resulting file:
$ cat version.txt
Build version information:
Timestamp: Wed Feb 8 12:27:28 CET 2012
Different build tools have different ways of doing this. There could be
that there is a plugin or feature in your build tool that produces a
You received this message because you are subscribed to the Google Groups "Git
for human beings" group.
To view this discussion on the web visit
To post to this group, send email to firstname.lastname@example.org.
To unsubscribe from this group, send email to
For more options, visit this group at