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

Re: Strange behavior with git rebase (-i)

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Feb 2, 2008, 15:42 UTC
Message-ID
<alpine.LSU.1.00.0802021538300.7372@racer.site>
In-Reply-To
<47A44974.7050907@samba.org>
Hi,
On Sat, 2 Feb 2008, Stefan (metze) Metzmacher wrote:
Show 11 quoted lines
> [started git rebase -i]
> git commit --amend (again)
> git branch
>  * v4-0-test
> git log
>  (this showed what I wanted)
> git show -p --stat
>  (to really make sure that the top revision is the one I want)
> git push origin v4-0-test
>  And this pushed the top revision BEFORE the rebase!!!
>  Because I forgot a 'git rebase --continue' to finalize the rebase.

I don't believe it. "git branch" would have shown "* (no branch)" as current branch, unless the rebase is finalized.

git rebase -i works on a _detached_ HEAD, for two reasons:
- easier working with reflogs (as the branch's reflog shows before rebase 
and after rebase, but nothing in between), and
- to prevent exactly the scenario you are describing.

Ciao, Dscho

Previous: Stefan (metze) MetzmacherNext: Steven Walter
Message 2 of 5 in “Strange behavior with git rebase (-i)”
  1. Stefan (metze) MetzmacherFeb 2, 2008
  2. Johannes SchindelinFeb 2, 2008
  3. Steven WalterFeb 2, 2008
  4. Johannes SchindelinFeb 2, 2008
  5. Stefan (metze) MetzmacherFeb 3, 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.