Git hook to enforce commit message in the format "#<issue number> | <message>"
$ vi .git/hooks/commit-msg
#!/bin/sh
test "" != "$(grep -Ei '^#[0-9]+\s?\|' "$1")" || {
echo >&2 Yo! Commit message needs to be in the form '#<issue number> | <text message>'.
exit 1
}
Written by Rajiv Nair
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
Related Tags
#git
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#