On Fri, Jul 29, 2016 at 12:02 PM, Konstantin Khomoutov
<flatw...@users.sourceforge.net> wrote:
>
> On Fri, 29 Jul 2016 09:10:06 -0700
> Michael <keybou...@gmail.com> wrote:
>
> > After doing a "git merge", I wind up with a few conflicts.
> >
> > My files have the three states.
> >
> > I am finding that I almost always want the third state (between ===
> > and >>>) to resolve these conflicts.
> >
> > How can I tell merge, AFTER seeing the conflicts, and looking at
> > them, to use the third option for resolution?
> >
> > To clarify: I'm not asking for the third state in all cases. I'm not
> > asking for those files to replace everything else (that's what I
> > understand the "--ours" option does). I'm not asking to do this on
> > the initial merge command before I've seen what the conflicts are
> > going to turn out to be.
> >
> > After I've done the "git merge" and it has failed, how can I then
> > auto-select on a file by file basis?
>
> I think you want
>
>   $ git checkout --ours .
>   $ git add -u
>   $ git commit
>
> "The trick" is that `git checkout` working on files, and not given a
> <tree-ish> argument to take contents from, uses the index, and for
> unmerged entries, the index stores two versions of the entry's
> content: theirs and ours.
>
> You might also use `git checkout --ours` on individual files, of course.

Here's what I cannot understand. I want the merged combination.

I don't want "my" version of the file.
I don't want "their" version of the file.

I want the merge, and the conflict in this file resolved by "mine" or "theirs".

What I see is this:
1. If I know that there is a conflict first, I can tell "git merge" to
use "--ours" or "--theirs". But that's "resolve the conflict by taking
my file / their file". No merging where there is no conflict. But
since this is a "before doing merge", it is useless after you merge.
2. If I find a conflict afterwards, I can use "git checkout --ours" or
"git checkout --theirs" to use the entire file. Again, no merging
where there is no conflict.

I am probably misunderstanding something.

How can I keep all non-conflicting merges and still resolve the
conflicting hunks?

Also: Why "ours" and "theirs"? Which one is which? I'm one person with
multiple branches.

-- 
This message may have been spell checked by a laptop kitten.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to