Last active
August 29, 2015 14:06
-
-
Save mrmike/8a069fa628f2d529744e to your computer and use it in GitHub Desktop.
Prepare 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 | |
| # save file as .git/hooks/prepare-commit-msg | |
| BRANCH=$(git symbolic-ref --short HEAD) | |
| TICKET=`echo $BRANCH | grep -o 'MOB-\d\{1,\}'` | |
| status=$? | |
| if [ $status -eq 0 ] ; then | |
| echo "[$TICKET]\n$(cat $1)" > $1 | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment