% cat .git/hooks/commit-msg #!/bin/bash BRANCH=$(git symbolic-ref HEAD) if [ "$BRANCH" == "refs/heads/master" ]; then echo -e "\033[31mcannot commit on master branch.\033[0m" echo -e "\033[31mplease commit on topic branch.\033[0m" exit 1 fi grep 'PROJECTNAME-[0-9]\+$' $1 if [ $? -eq 0 ]; then exit fi echo -e "\033[31mcannot commit without tikect id!!\033[0m" exit 1