Guest User

Untitled

a guest
Jan 16th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. ## add this to your .bashrc or .profile
  2.  
  3. git() {
  4. if [[ "$1" == "checkout" && "$2" == "." ]]; then
  5. while true; do
  6. read -p "Are you sure to checkout . [y/n]? " yn
  7. case "$yn" in
  8. [Yy]*)
  9. echo "checking out ."
  10. command git "$@"
  11. break
  12. ;;
  13. [Nn]*)
  14. echo "abort"
  15. break
  16. ;;
  17. *)
  18. printf %s\\n "Please answer [y]es or [n]o."
  19. esac
  20. done
  21. else
  22. command git "$@"
  23. fi
  24. }
Add Comment
Please, Sign In to add comment