# force a merge conflict

7 messages from 2008-11-09 to 2008-11-11. Participants: Caleb Cushing, Deskin Miller, Brett Simmers.
Thread: https://gitlist.dev/t/16237

## Caleb Cushing, 2008-11-09 15:09

Subject: force a merge conflict
Message-ID: <81bfc67a0811090709s483506c1h6f9cb0f96216ef22@mail.gmail.com>
URL: https://gitlist.dev/e/81bfc67a0811090709s483506c1h6f9cb0f96216ef22%40mail.gmail.com

```
is there any way to force a merge conflict?

there are 2 projects which have basically diverged becoming
incompatible, and both have updated since there common ancestry. I'm
working slowing on merging them back together.

in this case I have a dev branch and fork branch the fork is a copy of
dev except I committed one of the files from the fork. I need to merge
this file back into dev, but git thinks it's a fast forward, because
it really is for git, in reality it isn't, both files have newer
history than their common ancestry.

-- 
Caleb Cushing

```

## Deskin Miller, 2008-11-09 18:39

Subject: Re: force a merge conflict
Message-ID: <20081109183917.GA18415@euler>
URL: https://gitlist.dev/e/20081109183917.GA18415%40euler
In-Reply-To: <81bfc67a0811090709s483506c1h6f9cb0f96216ef22@mail.gmail.com>

```
On Sun, Nov 09, 2008 at 10:09:49AM -0500, Caleb Cushing wrote:
> is there any way to force a merge conflict?

I'm not sure a 'conflict' is what you want, based on what you say below;
rather, it seems you simply want to force a 'merge commit', i.e. a commit with
multiple parents.

> in this case I have a dev branch and fork branch the fork is a copy of
> dev except I committed one of the files from the fork. I need to merge
> this file back into dev, but git thinks it's a fast forward, because
> it really is for git, in reality it isn't, both files have newer
> history than their common ancestry.

git merge --no-ff ?

Hope that helps,
Deskin Miller

```

## Caleb Cushing, 2008-11-09 20:19

Subject: Re: force a merge conflict
Message-ID: <81bfc67a0811091219t393ab1faj8d1c4df6de3c260c@mail.gmail.com>
URL: https://gitlist.dev/e/81bfc67a0811091219t393ab1faj8d1c4df6de3c260c%40mail.gmail.com
In-Reply-To: <20081109183917.GA18415@euler>

```
> I'm not sure a 'conflict' is what you want, based on what you say below;
>  rather, it seems you simply want to force a 'merge commit', i.e. a commit with
>  multiple parents.

>
> git merge --no-ff ?
>
I tried that but I don't see that it's any different than a fast
forward in this scenario. Actually I don't see any difference between
it and a fast-forward.
-- 
Caleb Cushing

```

## Deskin Miller, 2008-11-09 20:35

Subject: Re: force a merge conflict
Message-ID: <20081109203526.GB18415@euler>
URL: https://gitlist.dev/e/20081109203526.GB18415%40euler
In-Reply-To: <81bfc67a0811091219t393ab1faj8d1c4df6de3c260c@mail.gmail.com>

```
On Sun, Nov 09, 2008 at 03:19:57PM -0500, Caleb Cushing wrote:
> > I'm not sure a 'conflict' is what you want, based on what you say below;
> >  rather, it seems you simply want to force a 'merge commit', i.e. a commit with
> >  multiple parents.
> 
> >
> > git merge --no-ff ?
> >
> I tried that but I don't see that it's any different than a fast
> forward in this scenario. Actually I don't see any difference between
> it and a fast-forward.

Look at the results of 'git merge' and 'git merge --no-ff' in gitk.  Or,
compare the resultant sha1 for the two commit objects.  Or, look at 'git log'
of the resulting commit objects, and look for a 'Merge:' line.

Deskin Miller

```

## Brett Simmers, 2008-11-10 19:11

Subject: Re: force a merge conflict
Message-ID: <e32b7bb40811101111o8c4334dj49a0c56c6dac6d15@mail.gmail.com>
URL: https://gitlist.dev/e/e32b7bb40811101111o8c4334dj49a0c56c6dac6d15%40mail.gmail.com
In-Reply-To: <81bfc67a0811091219t393ab1faj8d1c4df6de3c260c@mail.gmail.com>

```
> I tried that but I don't see that it's any different than a fast
> forward in this scenario. Actually I don't see any difference between
> it and a fast-forward.

If you want to be given a chance to edit the result before the merge
commit, you probably want 'git merge --no-commit'.

-Brett

```

## Caleb Cushing, 2008-11-11 17:10

Subject: Re: force a merge conflict
Message-ID: <81bfc67a0811110910ic7f3fa7u77676961b0eac118@mail.gmail.com>
URL: https://gitlist.dev/e/81bfc67a0811110910ic7f3fa7u77676961b0eac118%40mail.gmail.com
In-Reply-To: <e32b7bb40811101111o8c4334dj49a0c56c6dac6d15@mail.gmail.com>

```
> If you want to be given a chance to edit the result before the merge
>  commit, you probably want 'git merge --no-commit'.

That's the closest to what I need to do... unfortunately it's not what
I need to do. Apparently I'll have to do a vimdiff outside of git
since git doesn't appear to be capable of doing what I need it to do.

-- 
Caleb Cushing

```

## Caleb Cushing, 2008-11-11 17:24

Subject: Re: force a merge conflict
Message-ID: <81bfc67a0811110924y5ff6a669kee5cb33c92c6046d@mail.gmail.com>
URL: https://gitlist.dev/e/81bfc67a0811110924y5ff6a669kee5cb33c92c6046d%40mail.gmail.com
In-Reply-To: <85647ef50811110914w7e1d36afh23b43b44ba0e2cf3@mail.gmail.com>

```
> Is not the following option of the merge just for it?
>
>  --no-commit
>     Perform the merge but pretend the merge failed and do not
>  autocommit, to give the user a chance to inspect and further tweak the
>  merge result before committing.

yes and no... it doesn't auto-magically allow me to do what  a merge
conflict does. which is put together a diff. all it really did was not
commit the auto merge.

as far as --no-ff I'm not saying it commits the same way but I didn't
see any difference in the resulting diffs, which, imho, all that
matters is whether the resulting merged code is correct.


-- 
Caleb Cushing

```
