{"thread":{"id":"47084","subject":"How to resolve mixture of modified and deleted conflicts easily in git?","startedAt":"2017-10-31T16:31:29Z","lastAt":"2017-11-04T19:10:46Z","messageCount":2,"participants":["Robert Dailey","Philip Oakley"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"331477","messageId":"CAHd499AsY30b8LuCvjap-mZyzBEVsjK__We6Yh-y=5GqijObhw@mail.gmail.com","threadId":"47084","inReplyTo":null,"subject":"How to resolve mixture of modified and deleted conflicts easily in git?","fromName":"Robert Dailey","fromEmail":"rcdailey.lists@gmail.com","sentAt":"2017-10-31T16:31:22Z","receivedAt":"2017-10-31T16:31:29Z","isPatch":false,"sender":{"key":"rcdailey.lists@gmail.com","avatar":null},"body":"When doing a rebase, sometimes I will get `DU` and `UU` conflicts\n(locally deleted and locally modified, respectively). Furthermore, in\nsome of these cases, I want to take \"ours\" for all conflicts,\nincluding ones where the local file is deleted. Ideally, it's just one\ncommand:\n\n    $ git checkout --ours .\n\nHowever, this fails for the locally deleted conflicts:\n\n    error: path 'foo.xml' does not have our version\n\nEven more annoyingly, the fact that these failures occur prevents the\n`UU` conflicts from being resolved. The whole operation fails\natomically. I am not aware of a straightforward and uniform way to\nresolve conflicts with \"ours\" during a rebase when locally deleted\nfiles exist in the list of conflicts. What is the most elegant\nsolution in this situation?\n\nI'm running Git for Windows v2.13.1.\n"},{"id":"331830","messageId":"34068C1EF5694EBC8B86E1FF44B134FF@PhilipOakley","threadId":"47084","inReplyTo":"CAHd499AsY30b8LuCvjap-mZyzBEVsjK__We6Yh-y=5GqijObhw@mail.gmail.com","subject":"Re: How to resolve mixture of modified and deleted conflicts easily in git?","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":null,"receivedAt":"2017-11-04T19:10:46Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: \"Robert Dailey\" <rcdailey.lists@gmail.com>\n> When doing a rebase, sometimes I will get `DU` and `UU` conflicts\n> (locally deleted and locally modified, respectively). Furthermore, in\n> some of these cases, I want to take \"ours\" for all conflicts,\n> including ones where the local file is deleted. Ideally, it's just one\n> command:\n>\n>    $ git checkout --ours .\n>\n> However, this fails for the locally deleted conflicts:\n>\n>    error: path 'foo.xml' does not have our version\n>\n> Even more annoyingly, the fact that these failures occur prevents the\n> `UU` conflicts from being resolved. The whole operation fails\n> atomically. I am not aware of a straightforward and uniform way to\n> resolve conflicts with \"ours\" during a rebase when locally deleted\n> files exist in the list of conflicts. What is the most elegant\n> solution in this situation?\n>\n> I'm running Git for Windows v2.13.1.\n\nCan you give the example commands and response?\n\nIn particular note the comment in the rebase command that the ours/theirs \nviewpoints are swapped, so you may find your stated \"ours\" should be (mid \nrebase) seen as \"theirs\".\n--\nPhilip \n\n"}]}