From: Junio C Hamano Date: Wed, 16 Jul 2008 22:41:35 GMT Subject: Re: Considering teaching plumbing to users harmful Message-ID: <7vod4xo3j4.fsf@gitster.siamese.dyndns.org> In-Reply-To: <20080716223205.GK2167@mit.edu> Theodore Tso writes: > So from a pedagogical perspective, what I would probably do is show > them how to replicate svn-up, and explain to them how this script > works: > > #!/bin/sh > # git-up > > if git diff --quiet && git diff --quiet --cached ; then > git pull $* > else > git stash ; git pull $*; git stash pop > fi Looks good, except: if git diff ....; then git pull "$@" else git stash && git pull "$@" && git stash pop fi to make sure the conflict notices won't be scrolled off by error messages from the later commands.