Skip to content

Instantly share code, notes, and snippets.

@guangtuan
Created August 23, 2019 13:18
Show Gist options
  • Save guangtuan/becfee630137a5441d0297f12d5d916c to your computer and use it in GitHub Desktop.
Save guangtuan/becfee630137a5441d0297f12d5d916c to your computer and use it in GitHub Desktop.
pre-check git commit message
#!/bin/sh
MSG=$(cat $1)
if ! [[ "$MSG" =~ ^#[0-9]{4} ]];then
echo "Your commit message must starts with a story number, like "#1234""
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment