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

is rebase the same as merging every commit?

From
DJDavid Jeske <jeske@willowmail.com>
Date
Jun 26, 2008, 23:42 UTC
Message-ID
<1006.35704952783$1214525911@news.gmane.org>

Rebasing is described in the docs I've read as turning this: (sorry for the dots)

..........A---B---C topic ........./ ....D---E---F---G master

Into this:

...................A'--B'--C' topic ................../ .....D---E---F---G master

If I understand it right (and that's a BIG if), it's the same as doing a merge of C into G where every individual commit in the C-line is individually committed into the new C' line.

...........-------------A---B---C ........../ / / / ........./ /---A'--B'--C' topic ......../ / ....D---E---F---G - master

(1) Is the above model a valid explanation?

(2) From the documentation diagrams, it looks like the rebased A' has only (G) as a parent, not (A,G). If this is the case, why? (i.e. not connecting those nodes throws away useful information)

(3) If it only has (G) as a parent, does the rebase explicitly remove the source A,B,C nodes from the repository? (the diagrams make it look like it does) ..or do they just get cleaned up during GC?

Next: Junio C Hamano
Message 1 of 11 in “is rebase the same as merging every commit?”
  1. David JeskeJun 26, 2008
  2. Junio C HamanoJun 27, 2008
  3. Junio C HamanoJun 27, 2008
  4. David JeskeJun 27, 2008
  5. David JeskeAug 14, 2016
  6. Matthieu MoyJun 27, 2008
  7. David JeskeJun 27, 2008
  8. David JeskeAug 14, 2016
  9. Pascal ObryJun 27, 2008
  10. しらいしななこJun 27, 2008
  11. Junio C HamanoJun 27, 2008

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.