Created
August 31, 2017 19:59
-
-
Save DiogoCercilio/478ba99d2fb28a941260dbcb35c66556 to your computer and use it in GitHub Desktop.
Add branch name to commit message
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Go to ".git/hooks/prepare-commit-msg.sample", and rename this file to "prepare-commit-msg". | |
Insert the code below: | |
NAME=$(git branch | grep '*' | sed 's/* //') | |
echo "[$NAME] -" $(cat "$1") > "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment