git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Is there any way to "interrupt" a rebase?
@ 2018-02-19 19:35 Hilco Wijbenga
  2018-02-19 22:36 ` brian m. carlson
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Hilco Wijbenga @ 2018-02-19 19:35 UTC (permalink / raw)
  To: Git Users

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?)

Cheers,
Hilco

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-02-23 13:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).