Subject: Re: pull into dirty working tree

From: [email-masked] (Randal L. Schwartz)
Date: Wed, 13 Jun 2007 08:01:14 -0700

>>>>> "Bill" == Bill Lear <[email-masked]> writes:

Bill> We have some CVS users who complain that they cannot do a pull
Bill> into a dirty working tree, as they could under CVS.  Here is
Bill> their scenario: they make a few changes to their code and want
Bill> to test it out; someone else pushes changes to the central repo
Bill> that they then want to add to their working tree to test also;
Bill> they then want to pull in these changes and test everything, as
Bill> if they had done 'mv stuff stuff-; git pull; mv stuff- stuff'.

Bill> They would like an option (perhaps a config option) to do a "dirty
Bill> pull".

Maybe this will do it, presuming they haven't published any of their local
work, and they're on a topic branch "topic"

git-tag WIP # mark HEAD so we can come back
git-commit -a -m WIP # commit current work so we can replay it
git-fetch origin # grabs the upstream
git-rebase origin # rebase current work-in-progress onto new upstream
# might need to resolve and commit conflicts repeatedly
git-reset --soft WIP # next commit will be on top of commit prior to rebase
git-reset # mark all files as uncommitted as yet
git-tag -d WIP # no more need for this tag

This effectively puts the upstream changes "under" (or "prior to") the current
topic branch.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[email-masked]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!