Is there a hook that updates $ Id $ in files on clone / pull?

I have a bare (remote) GIT repository with several users blessed to commit there. In the clone / pull repository, I want each source file containing the magic of $Id:$ to be expanded to some. for example: $Id: <name-of-last-committer> <data> .

It would be great if this extended / compensated magic line would not affect the state of the file change.

I guess this is done through hooks. I wonder if there are any hooks ready for use? Or how can my problem with $Id be solved? Thanks.

+4
source share
2 answers

You should take a look at the Pro Git section on keyword expansion - I'm sure you can tailor this solution to your needs:

+3
source

I am using a pre-commit script to modify the $ Id: $ tag. He fills it all with current information. As for the version number, all I do is add to it. Thus, 1.012 becomes 1.013. The current time and date, as well as the current user, are added to the tag.

0
source

All Articles