首页 > 其他 > 详细

合并两个没有相同历史的Git仓库

时间:2020-01-06 13:56:10      阅读:92      评论:0      收藏:0      [点我收藏+]

首先在需要合并的仓库中增加另外一个远程仓库  git remote add test2 http://git.xxx.xxx/test2 

然后将test2的仓库拉取到本地  git fetch test2 

创建本地分支 git checkout -b test2 test2/master 

切换到目标分区  git checkout master 

将test2分支合并到master分支中  git merge test2 --allow-unrelated-histories 

至此分支合并完成,只需将分支提交到服务器即可


 

合并两个没有相同历史的Git仓库

原文:https://www.cnblogs.com/masahiro/p/12155758.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!