Skip to content

Instantly share code, notes, and snippets.

@robatwilliams
Created April 11, 2018 09:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robatwilliams/ce1ca6b2dc2a5ca6701db8841c75d2d5 to your computer and use it in GitHub Desktop.
Save robatwilliams/ce1ca6b2dc2a5ca6701db8841c75d2d5 to your computer and use it in GitHub Desktop.
# put in ~/.bashrc
alias git='gitwrapper'
gitwrapper () {
if [ "$1" == 'reset' ] && [ "$2" == '--hard' ]; then
\git status --short
read -n 1 -p 'Continue with hard reset (y/n)? ' answer
if [ "$answer" == 'y' ]; then
echo
\git "$@"
fi
else
\git "$@"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment