Created
July 2, 2014 18:13
-
-
Save Mihailoff/370abf643099bf42f7b7 to your computer and use it in GitHub Desktop.
Auto prepend branch name to commit message if name not start with "MOODLE_"
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
# .git/hooks/prepare-commit-msg | |
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD) | |
if [[ ! $BRANCH_NAME =~ ^MOODLE_ ]] ; then echo "$BRANCH_NAME " | cat - "$1" > "$1.tmp" && mv "$1.tmp" "$1"; fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment