All of lore.kernel.org
 help / color / mirror / Atom feed
From: Phillip Wood <phillip.wood@talktalk.net>
To: Hilco Wijbenga <hilco.wijbenga@gmail.com>,
	Git Users <git@vger.kernel.org>, Jeff King <peff@peff.net>,
	"brian m. carlson" <sandals@crustytoothpaste.net>
Subject: Re: Is there any way to "interrupt" a rebase?
Date: Tue, 20 Feb 2018 10:20:19 +0000	[thread overview]
Message-ID: <c1586003-1c7f-c9c9-9912-d48243305fa3@talktalk.net> (raw)
In-Reply-To: <CAE1pOi1XtrWqG7mOdrNt10YoZG0LOAB7i9cc1Gi8oWhULxE57A@mail.gmail.com>

On 19/02/18 19:35, Hilco Wijbenga wrote:
> 
> Hi all,
> 
> When maintaining a long running branch, I regularly rebase onto our
> active development branch so that my branch stays up-to-date. What
> happens fairly often is that during such a rebase, Git will exit
> because of rebase/merge conflicts. Nothing unexpected there, of
> course, but as it sometimes turns out, the conflict should have been
> fixed in an earlier commit. The only way that I know of to fix this,
> is to abort the rebase and start over with "git rebase ...
> --interactive" then "edit" every commit and go through them
> one-by-one. This is often overkill, though. Is there a better way?
> Perhaps I could "rewind" the rebase to an earlier commit and restart
> from there?
> 
> So a scenario like this:
> 
> my-branch : X -> A -> B -> C -> D -> E -> F -> G
> base-branch : X -> Y
> 
> git rebase --onto base-branch HEAD~7
> commit A --> conflicts
> .... lots of work ...
> commit B --> conflicts
> .... lots of work ...
> commit C (Git handles conflicts)
> commit D (no conflict)
> commit E --> conflicts
> .... er, that should have been fixed in commit C
> 
> How do I keep all the work I did for commits A and B? I get the
> impression that rerere does not help here because I did not finish the
> rebase succesfully (and that makes perfect sense, of course). Is there
> a way at this point in the rebase to "go back" to commit C (so without
> "git rebase --abort")?
> 
> (Surely, it's not as simple as doing a "git reset --hard
> sha-of-commit-C" is it?)

Hi Hilco

In the past when I've wanted to edit the commit directly rather than
create a fixup I've done something like

 git log --pretty="pick %h %s" C..
 git rebase --edit-todo
<paste the output of git log into the editor>
 git checkout C
<amend this commit>
 git commit --amend
 git rebase --continue


Best Wishes

Phillip
> Cheers,
> Hilco
> 


      parent reply	other threads:[~2018-02-20 10:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-19 19:35 Is there any way to "interrupt" a rebase? Hilco Wijbenga
2018-02-19 22:36 ` brian m. carlson
2018-02-19 23:09   ` Hilco Wijbenga
2018-02-20 11:03     ` Johannes Schindelin
2018-02-20 11:44       ` Johannes Schindelin
2018-02-20 20:56         ` Jeff King
2018-02-20 22:40           ` Jacob Keller
2018-02-23 13:12         ` Phillip Wood
2018-02-20  3:50 ` Jeff King
2018-02-20 10:20 ` Phillip Wood [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c1586003-1c7f-c9c9-9912-d48243305fa3@talktalk.net \
    --to=phillip.wood@talktalk.net \
    --cc=git@vger.kernel.org \
    --cc=hilco.wijbenga@gmail.com \
    --cc=peff@peff.net \
    --cc=phillip.wood@dunelm.org.uk \
    --cc=sandals@crustytoothpaste.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.