I have a number of template files in my git repository which change at different rates. These are then used to generate HTML pages. If someone reports a problem, I want them to be able to tell me which version of the template file has the problem. Currently, I manually enter the date into the file when I change it. Or, well, I try to. I forget most of the time.
At least in theory, I should be able to use git smudge and clean filters to fix the files and insert the date of last update automatically. This would be great.
Except that I develop on one machine, and when I'm ready, I push/pull to a different machine.
How do I get the smudge and clean filters to show up on the other machine? I don't want to have to add odd scripts to the path; this is only needed for this one repository, so I want to make it entirely self-contained. Everything online says "add this filter definition to your ~/.gitconfig, then add these scripts to your path, then set up the repository .gitattributes file". I want it so that if I go to a new computer and clone the repository, all of the clean and smudge is configured automatically.
Has anyone done this?