Replace git pull with git up -
i use git up
in order avoid merge bubbles, accidentally issue git pull
.
what best way systematically replace git pull
git up
?
as stated in git-config documentation, not possible alias existing git command.
we can use bash function asks confirm want use git pull
command, , offers opportunity use git up
instead:
function git() { if [[ $@ == "pull" ]]; read -p "do want [p]ull, [u]p or [a]bort? " yn case $yn in [pp]* ) command git pull;; [uu]* ) command git up;; * ) echo "bye";; esac else command git "$@" fi }
example
$ git pull want [p]ull, [u]p or [a]bort? u fetching origin master date $ git pull want [p]ull, [u]p or [a]bort? p up-to-date. $ git pull want [p]ull, [u]p or [a]bort? bye
Comments
Post a Comment