Erez Fridman
Erez Fridman

Reputation: 227

git pre-push no such file or directory

Just created a new pre-push file with the name "pre-push" under the path "myProjDir/.git/hooks"

While trying to git push --dry-run i'm getting the next error:

fatal: cannot run .git/hooks/pre-push: No such file or directory

What can I do to solve it?

Upvotes: 0

Views: 2198

Answers (2)

Mariusz K
Mariusz K

Reputation: 13

You can also try:

chmod 711 .git/hooks/pre-push

Upvotes: 0

Erez Fridman
Erez Fridman

Reputation: 227

The problem was the type of the "pre-push" file

I just copied the pre-commit file, renamed it to pre-push, changed the code inside and now it works.

Thanks!

Upvotes: 1

Related Questions