On Thu, Apr 28, 2011 at 01:36:27PM -0700, Greg Moser wrote:
> So in my .git/hooks folder I have a file named post-commit that looks like
> rm version.txt -i
> git describe --tags >> version.txt
> Basically the idea being that after every commit, I write the "git describe"
> to a file in my repository called version.txt. This script works fine
> except that I obviously once the file is edited, it needs to be committed.
> How should I achieve this end goal?
Use pre-commit hook instead and `git add` the updated version file in it.
On the other hand, I see no reason to put such a file under version
control--probably it could be more sensible to make generation of such
file a part of the build process.
Another option is to use .gitattributes and (re-)create the version file
upon checkout/update rather than commit. See the entry about the
"filter" attribute (in particular, its "smudge" command) in
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 email@example.com.
To unsubscribe from this group, send email to
For more options, visit this group at