Subject: Re: pull into dirty working tree

From: Pierre Habouzit <[email-masked]>
Date: Wed, 13 Jun 2007 16:47:43 +0200

On Wed, Jun 13, 2007 at 04:43:11PM +0200, Pierre Habouzit wrote:
> On Wed, Jun 13, 2007 at 04:38:45PM +0200, Pierre Habouzit wrote:

> >   I suppose the following way would work:
> > 
> >   $ git commit -a -m "temporary commit"  # save current work
> >   $ git branch -f dirty                  # ..in a separate branch
> >   $ git reset --hard HEAD~1              # unwind this commit
> >   $ git pull                             # perform a clean pull
> >   $ git rebase master dirty              # rewrite the work
> >   <you may have to fix some conficts here>
> 
> >   $ git reset master                     # "undo" the commit
> 
>   okay this is wrong because you would then "live" in the `dirty`
> branch. So you'd have to do sth like:
> 
>    git checkout master
>    git diff master..dirty | git apply

  Alternatively and definitely shorter:

  $ git commit -a -m "temporary commit"        # save the current work
  $ git checkout -f -b dirty HEAD~1            # have a dirty branch for the pull
  $ git pull                                   # perform the pull
  $ git rebase dirty master                    # rewrite the work
  <you may have to fix some conficts here>
  $ git reset HEAD~1                           # then unwind the commit

-- 
·O·  Pierre Habouzit
··O                                                [email-masked]
OOO                                                http://www.madism.org