Last active
December 22, 2018 18:38
-
-
Save dominiceden/eaf9c5fc18260c95c8ed7b0a462e9810 to your computer and use it in GitHub Desktop.
Automatically add branch name to every Git 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
#!/bin/sh | |
# | |
# Automatically adds branch name to every commit message. | |
# e.g. [feature/some-feature] Commit message here | |
# Remove .sh extension when copying into your .git/hooks folder. | |
# | |
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