1. Add default template directory
git config --global init.templatedir '~/.git-templates'
Files and directories in the defa...
For further actions, you may consider blocking this person and/or reporting abuse
Nice :)
By the way, since a few git versions, you can also use the
hooksPathconfig variable.So for instance you could have
prepare-commit-msgunder version control, in ahooksdirectory and then tell people to update the.git/configfile to look like:An other possibility is for you to write the same kind of config code in
~/.config/git/configand have yourprepare-commit-msgscript in just one place ;)Hope this helps.
I'm a fan of using commit templates as well to take our commit messages to the next level. robots.thoughtbot.com/better-commi...
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")
Hi Edwin
please make sure that
#!/bin/shis on top of your script file.I added this here as well, thanks for reaching out!
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!
Hmm, I followed the steps, and on git commit I don't see the branch name in vi. I did do a git init in my repo.
Sounds like a permission problem. Please have a look at the last hint, that is solving your problem. ✌🏻