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

Re: [BUG] git rebase is confuse if conflict resolution doesn't produce diff

From
Stephan Beyer <s-beyer@gmx.net>
Date
Aug 15, 2008, 18:24 UTC
Message-ID
<20080815182439.GB23326@leksak.fem-net>
In-Reply-To
<1218819643.6345.57.camel@cass-lpt>
Hi,
Guillaume Desmottes wrote:
Show 17 quoted lines
> To reproduce:
> - Rebase a branch "foo" on a branch "bar" in a way that there is a
> conflict that you have to manually resolve.
> - Run git diff and see the conflict
> - Edit the conflicted file and remove all the conflicting bits (that
> could be a valid resolution of the conflict)
> - Now git diff produces an empty diff
> - git add $CONFLICTED_FILE  as you have resolve the conflict
> - git rebase --continue
> 
> You get the following error:
> No changes - did you forget to use 'git add'?
> 
> git status is empty as the conflict was resolved.
> 
> A simple workaround is to add a dummy blank line in the conflicted file
> so the diff is not empty.

I think this is no bug, since you would generate an empty commit, i.e a commit with no changes at all. Usually you do not want such commits. So git rebase --skip is perhaps what you want.

Regards,
  Stephan
-- 
Stephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F
Previous: Guillaume DesmottesNext: Guillaume Desmottes
Message 2 of 4 in “[BUG] git rebase is confuse if conflict resolution doesn't produce diff”
  1. Guillaume DesmottesAug 15, 2008
  2. Stephan BeyerAug 15, 2008
  3. Guillaume DesmottesAug 18, 2008
  4. Junio C HamanoAug 15, 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.