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

Re: Q: howto rebase

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Sep 25, 2007, 14:49 UTC
Message-ID
<Pine.LNX.4.64.0709251548390.28395@racer.site>
In-Reply-To
<BAY105-F33DC84FACB8B66BFEB9EC8FFB70@phx.gbl>
Hi,
On Tue, 25 Sep 2007, lode leroy wrote:
Show 18 quoted lines
> I'm trying to understand how rebase works, but I need some help to get it.
> Suppose I do the following workflow... (see below)
> 
> In "version B" I introduce the "fix c", but in "version D" I realize it
> should have
> been in some other place. (commit D moves the fix to its proper place).
> A-B-C-D-E
> 
> Now I want to 'rewrite history'.
> I would like to move commit D after B
> A-B-D'-C'-E
> 
> and then fold the commits B and D' into a single commit.
> A-B'-C'-E
> 
> I somehow managed to get this done using "rebase -i"
> by exchanging the 2 appropriate lines, and then deleting the second one,
> but I'd like to understand how to do this from the command line...

Almost. Your "fold" is called "squash". So instead of deleting the second one, you probably wanted to squash it.

Hth, Dscho

Previous: lode leroyNext: Jeff King
Message 2 of 3 in “Q: howto rebase”
  1. lode leroySep 25, 2007
  2. Johannes SchindelinSep 25, 2007
  3. Jeff KingSep 25, 2007

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.