Skip to content

Instantly share code, notes, and snippets.

@jabranr
Last active June 20, 2016 12:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jabranr/c355742fafc862cdd56f0919aea93849 to your computer and use it in GitHub Desktop.
Save jabranr/c355742fafc862cdd56f0919aea93849 to your computer and use it in GitHub Desktop.
PUT a JIRA ticket numebr into commit message
# Save in .git/hooks/prepare-commit-msg
#
# This means that current branch was branched
# out from JIRA/Bitbucket and has a JIRA
# ticket number in its name.
JIRA=$(cat .git/HEAD | grep -Eo "[A-Z]+-[0-9]+")
echo "$JIRA" >> "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment