I just learned about git push --force-with-lease. It\'s pretty awesome. But, of course, I don\'t use force that often, and so I\'m worried that I might forget a
I want to be reminded that I shouldn't use -f, but I don't want to be fooled into believing that -f means --force-with-lease. So this is my take:
git() {
if [[ $@ == 'push -f'* ]]; then
echo Hey stupid, use --force-with-lease instead
else
command git "$@"
fi
}
Add to your .bash_profile, .bashrc or .zshrc.