1、分别拉取仓库1和仓库2:
2、项目1中完成需求并提交内容;
3、在项目2终端中执行:
a.添加wiser的remote地址到elko项目中:
git remote add wiser ssh://git@xxx/uiid1 (wiser 是添加到git config中的别名);
b.拉取最新的wiser代码到elko项目中:
git fetch wiser;
c.基于wiser/develop分支检出一个temp分支到elko项目中:
git checkout -b temp wiser/develop
d.切回到elko项目的最新分支(develop);
e.执行夸仓库合并命令:(允许跨仓库合并:--allow-unrelated-histories )
git merge --no-ff temp --allow-unrelated-histories
f.解决冲突后提交,elko面板同步wiser需求内容完成;
4、特别注意:
a.git配置不会被提交,clone的时候,需要重新添加remote地址;
b.本地媒介分支即使清除,不要提交到仓库里面;
c.命令较长,可以结合.gitconfig的alias 一起使用:
open ~/.gitconfig
[alias] 里面贴入如下内容:(没有alias在问价下面加一下)
d.执行一下:source ~/.bash.profile 就好了(不行的话再重启下IDE);
e.执行:
git auh1 ssh://git@xxx/uiid1 (把wiser的仓库地址贴过来)
git auh2
git auh3
git auh4 (不是develop的话全称切一下)
git auh5