Skip to content

Instantly share code, notes, and snippets.

@slattery
Created January 8, 2016 17:29
Show Gist options
  • Select an option

  • Save slattery/455ba2daec5950dd8a3d to your computer and use it in GitHub Desktop.

Select an option

Save slattery/455ba2daec5950dd8a3d to your computer and use it in GitHub Desktop.
Block specific git commands
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