/etc/.git/hooks/pre-commit is installed by etckeeper and runs etckeeper pre-commit, which deals with /etc/.etckeeper, including running "git add .etckeeper". Why that file would match a gitignore seems much less important than why git would run that hook in an entirely different git repository. core.hooksPath By default Git will look for your hooks in the $GIT_DIR/hooks directory. Set this to different path, e.g. /etc/git/hooks, and Git will try to find your hooks in that directory, e.g. /etc/git/hooks/pre-receive instead of in $GIT_DIR/hooks/pre-receive. Hmm, the example "/etc/git/hooks" there is very similar to the "/etc/.git/hooks" used by etckeeper. So my guess is you have core.hooksPath set globally. -- see shy jo
Attachment:
signature.asc
Description: PGP signature