I know that this is not normal practice and that my question is a “long shot”. But is there a way force git
to commit an unchanged file, so as to run githooks when the commit is pushed to GitHub, as well as for other post processing. I need git log <file>
to show the commit in the file’s change history even though the file wasn’t changed.
I’ve tried changing the file’s timestamp via touch <file>
and permissions via chmod <new-mode> <file>
, but git add
still fails to add the file to the index and git commit
reports “nothing to commit”. This is on Linux, specifically on Ubuntu 24.04.