Thanks for your answer

Am Sonntag, 28. Oktober 2012 12:50:15 UTC+1 schrieb Thomas Ferris 
> This reminds me of a similar but related question: How can we get SVN's 
> keyword substitution in Git.
> The short answer is: you can't. But when you think about it, this file you 
> want to create is actually just duplicating information which exists 
> elsewhere. The right way to go about it is to find some step in your 
> build/deployment mechanism, and create this file on the fly. We build our 
> products using Maven and Gradle, and both these build-tools have places 
> where we can hook in and generate a version.txt file with interesting 
> information from Git.
I think it is not a real keyword subsitution, because Git does not store 
any information about numbering or anything else. In my depolyment process 
it should be used for creating the documentation, so I need the "date of 
the checkout" and the branch / tag name. This information are in the repo 
all time, so I need only to push them into a code file on the checkout.

Another way is to create it on checkout, as suggested in the git-scm.combook:
> From
> SVN- or CVS-style keyword expansion is often requested by developers used 
> to those systems. The main problem with this in Git is that you can’t 
> modify a file with information about the commit after you’ve committed, 
> because Git checksums the file first. However, you can inject text into a 
> file when it’s checked out and remove it again before it’s added to a 
> commit. Git attributes offers you two ways to do this.[...]
I have read this chapter and I don't want modify the file on commiting. I 
have a central repo in which each local repo is pushed, the documentation 
is created on the server. I have create a post-received hook for doing 
this, but I would like to add some information of the actually code before 
the documentation is created

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
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to