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

Problem with git when rebasing

From
IBIsmael Bouya <ismael.bouya@normalesup.org>
Date
Oct 29, 2014, 13:48 UTC
Message-ID
<20141029134847.GF12302@ns208507.ip-188-165-209.eu>

Hi all, git rebase can sometimes "forget" a commit, here is the workflow to reproduce this problem:

$ git init . $ echo "content 1" > file1 $ git add file1 && git commit -m "C1" $ echo "content 2" > file2 $ git add file2 && git commit -m "C2" $ echo "content 3" > file3 $ echo "content 2.3" >> file2 $ git add file3 && git commit -a -m "C3" $ echo "content 4" > file4 $ git add file4 && git commit -a -m "C4" $ git rebase -i HEAD^^ <change "pick" to "edit" for C2> $ echo "content 2" > file3 $ git rebase --continue

Here, we get an error
------
error: The following untracked working tree files would be overwritten by merge:
  file3
Please move or remove them before you can merge.
Aborting
Could not apply <hash_C3>... C3
------
This is expected, as we have created an untracked file which will be created
later.

However, if we remove/move away the file3 which conflicts, the "git status" command is misleading, in the sense that it doesn't tell us to run git cherry-pick <hash_C3> Or something approaching. If we don't, then commit <hash_C3> is completely forgotten by the rebasing once we continue it.

Maybe a more explanatory error message would be useful? It is very unclear that the commit won't apply when we continue the rebase workflow.

Kind regards,
-- 
Ismael
Message 1 of 1 in “Problem with git when rebasing”
  1. Ismael BouyaOct 29, 2014

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.