How to add Git's branch name to the commit message?
I need some help with a Bash script that will automatically add the git's branch name as a hash in commit messages. ninjagecko Use the prepare-commit-msg or commit-msg githook . There are examples already in your PROJECT/.git/hooks/ directory. As a security measure, you will have to manually enable such a hook on each repository you wish to use it. Though, you can commit the script and copy it on all clones into the .git/hooks/ directory. shytikov Here is my commit-msg script as an example: #!/bin/sh # # Automatically adds branch name and branch description to every commit message. # NAME=$