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

Re: How to resolve mixture of modified and deleted conflicts easily in git?

From
Philip Oakley <philipoakley@iee.org>
Date
Nov 4, 2017, 19:10 UTC
Message-ID
<34068C1EF5694EBC8B86E1FF44B134FF@PhilipOakley>
In-Reply-To
<CAHd499AsY30b8LuCvjap-mZyzBEVsjK__We6Yh-y=5GqijObhw@mail.gmail.com>
From: "Robert Dailey" <rcdailey.lists@gmail.com>
Show 20 quoted lines
> When doing a rebase, sometimes I will get `DU` and `UU` conflicts
> (locally deleted and locally modified, respectively). Furthermore, in
> some of these cases, I want to take "ours" for all conflicts,
> including ones where the local file is deleted. Ideally, it's just one
> command:
>
>    $ git checkout --ours .
>
> However, this fails for the locally deleted conflicts:
>
>    error: path 'foo.xml' does not have our version
>
> Even more annoyingly, the fact that these failures occur prevents the
> `UU` conflicts from being resolved. The whole operation fails
> atomically. I am not aware of a straightforward and uniform way to
> resolve conflicts with "ours" during a rebase when locally deleted
> files exist in the list of conflicts. What is the most elegant
> solution in this situation?
>
> I'm running Git for Windows v2.13.1.
Can you give the example commands and response?

In particular note the comment in the rebase command that the ours/theirs viewpoints are swapped, so you may find your stated "ours" should be (mid rebase) seen as "theirs". -- Philip

Previous: Robert Dailey
Message 2 of 2 in “How to resolve mixture of modified and deleted conflicts easily in git?”
  1. Robert DaileyOct 31, 2017
  2. Philip OakleyNov 4, 2017

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.