Created
September 15, 2015 10:15
-
-
Save kujiy/651c6931c4b5e0eff815 to your computer and use it in GitHub Desktop.
Git hook / A commit-msg for add branch name to commit message
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 | |
#ブランチ名を取得 | |
Branch="$(git rev-parse --abbrev-ref HEAD)" | |
#コミットメッセージの最初にブランチ名を追加 | |
mv $1 $1.tmpbycommit-msg | |
echo -n "[$Branch] " > $1 | |
cat $1.tmpbycommit-msg >> $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment