Created
January 8, 2016 17:29
-
-
Save slattery/455ba2daec5950dd8a3d to your computer and use it in GitHub Desktop.
Block specific git commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function git() { | |
| blocked=(merge pull) | |
| if [ -n "$1" ]; then | |
| for b in "${blocked[@]}"; do | |
| if [ "$1" == "$b" ]; then | |
| printf "\"It is easier to prevent bad habits than to break them.\"\n—Benjamin Franklin\n" | |
| return | |
| fi | |
| done | |
| fi | |
| command git "$@" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment