Skip to content

Instantly share code, notes, and snippets.

@scherler
Created October 17, 2017 14:22
Show Gist options
  • Save scherler/22a08d1d0548602ffca228acaf19ad21 to your computer and use it in GitHub Desktop.
Save scherler/22a08d1d0548602ffca228acaf19ad21 to your computer and use it in GitHub Desktop.
#!/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