icn
icn

Reputation: 17886

how to check in pre-commit file to git repository

I try to add a new pre-commit in myrepo/.git/hooks/pre-commit. How come I don't see this pre-commit new file when I run

git status

Some git configuration or setting I need to turn on?

THanks

Upvotes: 0

Views: 288

Answers (1)

qqx
qqx

Reputation: 19495

Hooks and other files in the .git directory cannot be version controlled. You can put the hook script somewhere outside of the .git directory to have it version controlled, then either symlink or copy it into the hooks directory to have it actually be used.

Upvotes: 2

Related Questions