force fail commit on master
Most of the time, you want to fail if you mistakenly commit to master. This is if you normally work with feature branch. This script can make git commit fail if the branch is master
current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
if [ "$current_branch" == "master" ]
echo "Should not commit on master branch. Use 'git commit -n' to override"