Stumbled across this error today to waste a good amount of time, while trying to have gerrit hook setup for a repository, was using the following command scp -p -P 29418 [email protected]:hooks/commit-msg .git/hooks/
on terminal
after having checked-out the project via XCode
Two reasons for this are:
- Executing hook command on incorrect folder. Makes sure to execute this command on
parent
folder of thechecked-out
folder & not onchecked-out
folder. - Executing hook on a different branch other than on the
master
branch. Make sure to run the hook command on themaster
branch, before switching/checking-out a different branch.