- Copy the file
commit-msg
to.git/hooks/commit-msg
- Make sure your delete the sample file
.git/hooks/commit-msg.sample
- Make commit msg executable.
chmod +x .git/hooks/commit-msg
- Edit
commit-msg
to better fit your development branch, commit regex and error message - Profit $$
curl https://gist.githubusercontent.com/EricTendian/1cac4d1a269c3caaae1e6c16a2de89ff/raw/commit-msg.sh > .git/hooks/commit-msg
rm .git/hooks/commit-msg.sample
chmod +x .git/hooks/commit-msg
vim .git/hooks/commit-msg
echo "Profit $$"