Skip to content

Instantly share code, notes, and snippets.

@tekkies
Created September 17, 2015 11:08
Show Gist options
  • Save tekkies/3d9fb04b6e4b43618caf to your computer and use it in GitHub Desktop.
Save tekkies/3d9fb04b6e4b43618caf to your computer and use it in GitHub Desktop.
Git commit-msg hook to enforce usage of #risk and #story (e.g. #risk3, #story1234)
#!/bin/sh
# Save this file as .git/hooks/commit-msg
test "" != "$(grep '\#risk' "$1")" || {
echo >&2 \#risk is required in the commit message
exit 1
}
test "" != "$(grep '\#story' "$1")" || {
echo >&2 \#story is required in the commit message
exit 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment