git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Effective difference between git-rebase and git-resolve

From
Junio C Hamano <junkio@cox.net>
Date
Mar 25, 2006, 06:08 UTC
Message-ID
<7v64m3ys3a.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0603242014160.15714@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
Show 10 quoted lines
> As to rebase, it often is very nice, but on the other hand, it leaves 
> things in a total mess when it fails, which is a pity. Maybe there's a 
> nice way to just continue, but I end up just doing a
>
> 	git reset --hard ORIG_HEAD
>
> to undo the failed rebase.
>
> Junio, is there some magic to restart a rebase after you've fixed up the 
> conflicts?

The modern rebase is essentially git-format-patch piped to git-am (with -3 flag to allow falling back to three-way merge), and all the familiar "the patch did not apply -- what now?" techniques can be employed.

Since the pre-image blobs recorded in the intermediate format-patch output by definition exist in your repository, it always falls back to three-way merge when the patch does not apply cleanly. Then you can resolve and say "git am --resolved" to continue.

Previous: Linus TorvaldsNext: Marc Singer
Message 3 of 10 in “Effective difference between git-rebase and git-resolve”
  1. Marc SingerMar 25, 2006
  2. Linus TorvaldsMar 25, 2006
  3. Junio C HamanoMar 25, 2006
  4. Marc SingerMar 25, 2006
  5. Junio C HamanoMar 25, 2006
  6. J. Bruce FieldsMar 26, 2006
  7. Junio C HamanoMar 25, 2006
  8. Johannes SchindelinMar 25, 2006
  9. Mark WoodingMar 25, 2006
  10. Johannes SchindelinMar 25, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.