Created
April 30, 2012 13:48
-
-
Save arnalyse/2558504 to your computer and use it in GitHub Desktop.
Git: branch name pre-included in 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 | |
/usr/bin/perl -pi -e \ | |
'print `git symbolic-ref HEAD | sed -e "s|.*/\\(.*\\)|#[\\1] |"` | |
if $. == 1' \ | |
"$1" | |
# copy this code into .git/hooks/prepare-commit-msg | |
# change the file permissions afterwards to 775 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment