Skip to content

Instantly share code, notes, and snippets.

@meain
Last active April 7, 2018 06:40
Show Gist options
  • Save meain/4a31548d87dd0c2ae3d3e822d4400751 to your computer and use it in GitHub Desktop.
Save meain/4a31548d87dd0c2ae3d3e822d4400751 to your computer and use it in GitHub Desktop.
Make commit message have the format `[for] commit message`
#!/bin/bash
test "" = "$(cat "$1" | head -n 1 | grep -v '^\[.*\]\ .*')" || {
echo >&2 "Commit message format is: [git] added new commit message hook"
exit 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment