Last active
March 8, 2018 19:04
-
-
Save MHolmes91/64e85fc194f00956493441aae96ee0b9 to your computer and use it in GitHub Desktop.
Add branch name to every git commit
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
#!/bin/sh | |
# | |
# Add branch name to every commit message. | |
BRANCH=$(git branch|grep '*'|sed 's/\* //') | |
echo "${BRANCH}: $(cat $1)" > "$1"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this file (
commit-msg
) to your repository's .git/hooks folder to enable this functionality.