Any tools to merge 2 git repos?

时间:2018-09-18 19:59:06

标签: merge gitlab

I am trying to merge 2 gitlab repos with all history but failing. Are there any gui tools or script to achieve it?

Since this is going to be a ongoing activity I am looking for something easier way

1 个答案:

答案 0 :(得分:1)

Just use the existing tools provided by git:

You can register one of your repos as origin and one as upstream...

git remote set-url origin git@xxx...
git remote set-url upstream git@xxx...

...then you can merge your changes from one repo into the other by first checking out your origin...

git checkout -b mybranch origin/mybranch

...and then merging your upstream into your local branch

git merge upstream/somebranch

... then pushing back into your origin

git push origin mybranch

Hope this helps