Created
October 10, 2016 17:19
-
-
Save jeffreysbrother/4e90ca360443c0c682b2f50c56baed57 to your computer and use it in GitHub Desktop.
Add branch name to beginning of commit message
This file contains hidden or 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
# add file to {projectname}/.git/hooks/ | |
# please ensure that the .sample extension is not included | |
NAME=$(git branch | grep '*' | sed 's/* //') | |
DESCRIPTION=$(git config branch."$NAME".description) | |
echo "$NAME"' '$(cat "$1") > "$1" | |
if [ -n "$DESCRIPTION" ] | |
then | |
echo "" >> "$1" | |
echo $DESCRIPTION >> "$1" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment