Reputation: 413
I have a repository that I created with git version 1.7.12
.
However, I have updated to version 1.8.2.3
. This has the hook pre-push. Newly created repositories with this version use the pre-push hook. However when I add the pre-push to an existing repo, I get the following error
:
fatal: cannot exec '.git/hooks/pre-push': Not a directory
Any help?
Thanks!
Upvotes: 2
Views: 2196
Reputation: 224864
I just made a brand new repository, and the pre-push.sample
is there, as you say. It for some reason doesn't have execute permission set, though, so it doesn't work when renamed to pre-push
. If you add execute permission:
chmod +x .git/hooks/pre-push
You should be ok. The provided sample had a bash if/then bug too. Changing line 32 from:
# Handle delete
to:
: # Handle delete
fixed it for me.
Upvotes: 3