Thread (22 messages) flat view 22 messages, 9 authors, 2016-06-15

Re: pull into dirty working tree

From: Pierre Habouzit <hidden>
Date: 2016-06-15 22:43:16

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:
quoted
  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>
quoted
  $ 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                                                madcoder@debian.org
OOO                                                http://www.madism.org

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help