Block a git branch from being pushed
Here’s how the pre-push hook approach works, with a branch called dontpushthis. Create this file as .git/hooks/pre-push: #!/usr/bin/bash if [[ `grep ‘dontpushthis’` ]]; then echo “You really don’t want to push this branch. Aborting.” exit 1 fi This works because the list of refs being pushed is passed on standard input. So this will also … Read more