Skip to content

Instantly share code, notes, and snippets.

@TSchuermans
Last active March 29, 2016 18:00
Show Gist options
  • Save TSchuermans/4a3e9a8e06afa0d990c78a559e7fd16b to your computer and use it in GitHub Desktop.
Save TSchuermans/4a3e9a8e06afa0d990c78a559e7fd16b to your computer and use it in GitHub Desktop.
init-commit-msg.sh
# If the project does not have a repository yet, initialise it.
git init
# Rename the sample hook file
mv ./.git/hooks/commit-msg.sample ./.git/hooks/commit-msg
# Make the hook file executable
chmod +x ./.git/hooks/commit-msg
# Edit the hook file with your editor (atom, vi, sublime, ...)
atom ./.git/hooks/commit-msg
# Paste the content of
# https://gist.github.com/TSchuermans/eecf5c4c23aa96689445bb9f6103d75c
# into your editor and modify the pattern.
# Save the hook file.
# Done! your commits will now be validated each time
# (unless you use the --no-verify option)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment