git 合并不同库的代码

1.在需要合并的库上(K1)添加新的远程库(K2)地址

git remote add old url

2.拉取代码(K1)

git fetch --all

3.切换到K1的分支上

4.执行Merge

5.执行Commit

6.执行pull

如果遇到refusing to merge unrelated histories 添加--allow-unrelated-history选项(windows TortoseGit会弹出框提醒)

posted @ 2021-01-10 16:16  广林  阅读(336)  评论(0编辑  收藏  举报