Thread (5 messages) flat view 5 messages, 2 authors, 2021-12-29

Re: request: allow passing -X <strategy-option> to git checkout <path> to auto-solve merge conflicts

From: Andrey Butirsky <hidden>
Date: 2021-12-28 20:44:41

Thanks Erik, please post your further replies to the mailing list so 
others could see it also.

On a topic,
I'm not familiar with Git code-base so don't know if it even possible in 
it's current architecture..


On 28.12.2021 20:32, Erik Cervin Edin wrote:
That's my answer =)

I think adding a merge strategy option to checkout might be useful

On Mon, Dec 27, 2021 at 4:49 PM Andrey Butirsky [off-list ref] wrote:
quoted
Hi, stumbling upon this again and again, so decided to write finally,

while in conflicting state, the only thing we can do to auto-pick one or
another side of conflict is passing --ours/--theirs option to git-checkout:
git checkout --ours/--theirs <path>

The problem is - it doesn't actually do a _merge_, i.e. you lose all
non-conflicted changes.

There is no easy way to solve that currently without third-party tools.

This link illustrates it:
https://stackoverflow.com/a/68498101/1063363

Proposal:
Shell we add -X <strategy-option> to git checkout <path> to allow it do
a merge and _actually solve_ merge conflicts?
That would be in-pair with other commands taking the option already:
git-merge, git-rebase, (etc.?)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help