Git: Merge Unrelated Repos

Tagged as:

So I have this repo - [email protected]:k4ml/ and I want to merge
it with [email protected]:barryclark/jekyll-now.git. Both repos are not related.

git clone [email protected]:k4ml/
git pull -s recursive -X theirs [email protected]:barryclark/jekyll-now.git master

You’ll see a warning about no common commits but the merge proceed:-

warning: no common commits
remote: Counting objects: 1257, done.
remote: Total 1257 (delta 0), reused 0 (delta 0), pack-reused 1257
Receiving objects: 100% (1257/1257), 8.17 MiB | 1.09 MiB/s, done.
Resolving deltas: 100% (698/698), done.
 * branch            master     -> FETCH_HEAD
 Auto-merging index.html

The theirs merge strategy option mean if there’s conflict (similar filename for example), the incoming
version will be used.

I’d first seen this being used in Openshift example.

Other merge tips from Orchestra project -

Written on January 28, 2016 by kamal
About author

Lead Engineer at Xoxzo Inc. Develop web applications in Python/Django. Interested in open source and tech talent development. provide API services for developer to develop messaging and voice based application. The postings on this site are my own and don't necessarily represent my employer's positions, strategies or opinions. I can be reached via Twitter @k4ml.

Ikuti perkembangan terkini melalui twitter kami @koditi atau FB Page