-
-
Save scherler/22a08d1d0548602ffca228acaf19ad21 to your computer and use it in GitHub Desktop.
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/bash | |
usage() | |
{ | |
cat << EOF | |
usage: $0 options | |
This script will tag the commit message with the branch info. e.g. [TENPA-1-branch-name] message. | |
You will need to pass the commit message as argument | |
OPTIONS: | |
-h Show this message | |
EOF | |
} | |
while getopts “hl:” OPTION | |
do | |
case $OPTION in | |
h) | |
usage | |
exit 1 | |
;; | |
esac | |
done | |
if [[ $# -eq 0 ]] ; then | |
usage | |
exit 1 | |
fi | |
mes='['`git rev-parse --abbrev-ref HEAD`']' | |
echo 'git commit -m "'$mes $*'"'|sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment