DEV Community

Discussion on: How to customise your git commit message

Collapse
 
edwin_r_c profile image
Edwin Ramirez

Getting this error after following every step by the letter.

$ git commit
.git/hooks/prepare-commit-msg: 2: .git/hooks/prepare-commit-msg: Syntax error: "(" unexpected (expecting "fi")

Collapse
 
ebud7 profile image
Sebastian

Hi Edwin

please make sure that #!/bin/sh is on top of your script file.

I added this here as well, thanks for reaching out!

Collapse
 
edwin_r_c profile image
Edwin Ramirez

Hi, sorry for not giving back any feedback. For some reason this didn't work on Linux Mint. Buuuuut it worked perfectly on Mac OS Sierra. I think, maybe, I missed that last hint:
"You might have to set the permissions on your new hook. (sudo chmod 775 .git/hooks/prepare-commit-msg)".
Thanks a lot!