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

git-rebase --continue eats commits

From
MMadhu <enometh@meer.net>
Date
Aug 31, 2013, 15:26 UTC
Message-ID
<20130831.205606.373615550.enometh@meer.net>
In-Reply-To
<20100626125924.160F11F212@leonis4.robolove.meer.net>

Don't know if this has been resolved-by-debate here before, But if `git-rebase' finds a hitherto untracked file in the worktree, which it wants to create, it then aborts asking you to remove the file. So if you remove it and ask git to continue with `git-rebase --continue', it then deletes the commit that was being applied from the branch. ---Madhu

(setenv "TDIR" "/dev/shm/foo/")

mkdir -pv $TDIR && cd $TDIR && git-init (cd $TDIR && echo a > a && git add a && git commit -m "a") (cd $TDIR && echo b > b && git add b && git commit -m "b") (cd $TDIR && echo c > c && git add c && git commit -m "c") (cd $TDIR && EDITOR="sed -i -e 's/^pick/edit/'" git rebase -i 'HEAD^^') (cd $TDIR && echo fubar > c) (cd $TDIR && git-rebase --continue)

    Rebasing (2/2)
error: The following untracked working tree files would be overwritten by merge:
	c
    Please move or remove them before you can merge.
    Aborting
    Could not apply ddd6f51...

(cd $TDIR && rm -fv c) (cd $TDIR && git-rebase --continue)

    Rebasing (2/2)
Successfully rebased and updated refs/heads/master.
(cd $TDIR && git log)
;; commit `c' is gone
Previous: Pete Harlan
Message 6 of 6 in “git-rebase --abort eats files”
  1. MadhuJun 26, 2010
  2. Johannes SixtJun 26, 2010
  3. Ramkumar RamachandraJun 28, 2010
  4. MadhuJun 29, 2010
  5. Pete HarlanJun 29, 2010
  6. git-rebase --continue eats commitsMadhu, Aug 31, 2013

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.