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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -