Reputation: 5854
I have a number of text files under git control. The files include a line of text such as this:
Date of this revision: 23.05.2021
Is it possible to make git update this automatically whenever the file is committed? I know it can be done in version control systems such as RCS, but I haven't been able to find a way to do it in git.
Upvotes: 4
Views: 587
Reputation: 11070
I think that a solution may be to write a git client hook by writing an pre-commit hook in order to:
The nasty thing is that you have to create a template on each developer machine to initialize the repo with the hook(s) at each git clone.
Here https://www.omerkatz.com/blog/2013/5/23/git-hooks-part-2-implementing-git-hooks-using-python you can find a lot of information about writing and managing hooks.
Upvotes: 3