#!/bin/sh BOLD='\033[1;36m' NC='\033[0m' branch=`git branch --show-current` if [ "$branch" = "master" ]; then msg=`cat .git/COMMIT_EDITMSG` echo $msg grep -q "(master)" <<< "$msg" if [ $? -eq 1 ]; then printf "${BOLD}[PRE-COMMIT]${NC} Commit message does not contain the substring '(master)', aborting...\n" exit 1; fi; fi