# [PATCH] howto/using-merge-subtree: mention --allow-unrelated-histories

2 messages from 2018-10-24 to 2018-10-25. Participants: Uwe Kleine-König, Junio C Hamano.
Thread: https://gitlist.dev/t/49661

## Uwe Kleine-König, 2018-10-24 08:04

Subject: [PATCH] howto/using-merge-subtree: mention --allow-unrelated-histories
Message-ID: <20181024080452.11876-1-uwe@kleine-koenig.org>
URL: https://gitlist.dev/e/20181024080452.11876-1-uwe%40kleine-koenig.org

```
Without passing --allow-unrelated-histories the command sequence
fails as intended since commit e379fdf34fee ("merge: refuse to create
too cool a merge by default"). To setup a subtree merging unrelated
histories is normal, so add the option to the howto document.

Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
---
 Documentation/howto/using-merge-subtree.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/howto/using-merge-subtree.txt b/Documentation/howto/using-merge-subtree.txt
index 1ae8d1214ec0..a499a94ac228 100644
--- a/Documentation/howto/using-merge-subtree.txt
+++ b/Documentation/howto/using-merge-subtree.txt
@@ -33,7 +33,7 @@ Here is the command sequence you need:
 
 ----------------
 $ git remote add -f Bproject /path/to/B <1>
-$ git merge -s ours --no-commit Bproject/master <2>
+$ git merge -s ours --no-commit --allow-unrelated-histories Bproject/master <2>
 $ git read-tree --prefix=dir-B/ -u Bproject/master <3>
 $ git commit -m "Merge B project as our subdirectory" <4>
 
-- 
2.19.1


```

## Junio C Hamano, 2018-10-25 05:43

Subject: Re: [PATCH] howto/using-merge-subtree: mention --allow-unrelated-histories
Message-ID: <xmqqd0ryk2ci.fsf@gitster-ct.c.googlers.com>
URL: https://gitlist.dev/e/xmqqd0ryk2ci.fsf%40gitster-ct.c.googlers.com
In-Reply-To: <20181024080452.11876-1-uwe@kleine-koenig.org>

```
Uwe Kleine-König <uwe@kleine-koenig.org> writes:

> Without passing --allow-unrelated-histories the command sequence
> fails as intended since commit e379fdf34fee ("merge: refuse to create
> too cool a merge by default"). To setup a subtree merging unrelated
> histories is normal, so add the option to the howto document.
>

Thanks.  We should have been more careful when we tightened "git
merge".

Will apply.

> Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
> ---
>  Documentation/howto/using-merge-subtree.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Documentation/howto/using-merge-subtree.txt b/Documentation/howto/using-merge-subtree.txt
> index 1ae8d1214ec0..a499a94ac228 100644
> --- a/Documentation/howto/using-merge-subtree.txt
> +++ b/Documentation/howto/using-merge-subtree.txt
> @@ -33,7 +33,7 @@ Here is the command sequence you need:
>  
>  ----------------
>  $ git remote add -f Bproject /path/to/B <1>
> -$ git merge -s ours --no-commit Bproject/master <2>
> +$ git merge -s ours --no-commit --allow-unrelated-histories Bproject/master <2>
>  $ git read-tree --prefix=dir-B/ -u Bproject/master <3>
>  $ git commit -m "Merge B project as our subdirectory" <4>

```
