Created
November 4, 2014 06:59
-
-
Save yuki777/926a74186e6ee91309b5 to your computer and use it in GitHub Desktop.
.git/hooks/prepare-commit-msg
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/bash | |
file=$1 | |
mode=$2 | |
if [ "$mode" = "" ] || [ "$mode" = "message" ] ; then | |
branch=`git rev-parse --abbrev-ref HEAD` | |
if [ "$branch" != "master" ]; then | |
if [ "$branch" != "" ]; then | |
mv $file $file.tmp | |
echo -n "[#$branch] " > $file | |
cat $file.tmp >> $file | |
fi | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
chmod 775 git/hooks/prepare-commit-msg