I am using git pre-commit hook to check commits. The pre-commit script basically does one thing:
exec git diff-index --check --cached HEAD --
He also does some other things, but they are not relevant to this discussion.
The problem is that I have all kinds of files in the repository, and not all of them have to perform checks that are performed using " git diff-index --check ".
So my question is: how can I exclude / ignore these files? That is, I track them in git, but I want to ignore them only when checking before committing.
For example, a specific patch contains * .c, * .h, * ini and * .xyz files. I want git diff-index --check apply only to .c and .h files.
git
kliteyn
source share