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 tttt@tttt.ttt.com: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
parentfolder of thechecked-outfolder & not onchecked-outfolder. - Executing hook on a different branch other than on the
masterbranch. Make sure to run the hook command on themasterbranch, before switching/checking-out a different branch.