Skip to content

Instantly share code, notes, and snippets.

@shamique
shamique / commit-msg
Last active August 18, 2018 16:04
git hook example - commit-msg
#!/bin/sh
# regex pattern for standard message
message_format='^\ABC-[0-9]{4}'
if ! grep -iqE "$message_format" "$1"; then
echo "Error: commit message should follow the pattern of ABC-1234 commit message"
exit 1
fi