Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git hook permission denied

When I am trying to run git commit -m 'message here' I am getting following error.

fatal: cannot exec '.git/hooks/prepare-commit-msg': Permission denied

This issue started after when I created a new partition on my ubuntu and cloned the repo in it.

like image 651
Sushmit Sagar Avatar asked Aug 31 '25 20:08

Sushmit Sagar


1 Answers

You'll need to make your file executable, the below code snippet will make the file executable for the owner, the group and the world:

$ chmod +x .git/hooks/prepare-commit-msg
like image 126
Andreas Louv Avatar answered Sep 03 '25 10:09

Andreas Louv