Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## add this to your .bashrc or .profile
- git() {
- if [[ "$1" == "checkout" && "$2" == "." ]]; then
- while true; do
- read -p "Are you sure to checkout . [y/n]? " yn
- case "$yn" in
- [Yy]*)
- echo "checking out ."
- command git "$@"
- break
- ;;
- [Nn]*)
- echo "abort"
- break
- ;;
- *)
- printf %s\\n "Please answer [y]es or [n]o."
- esac
- done
- else
- command git "$@"
- fi
- }
Add Comment
Please, Sign In to add comment