由於您需要從其他公司的分支合併到主分支,因此這是一個無關歷史合併。但SourceTree不支持合併--allow-unrelated-history,所以你最好使用git command line
。下面是供你參考的git命令:
git clone <URL for your own repo>
git remote add otherrepo <URL for the other company’s repo>
git pull otherrepo #pull otherrepo to your local repo
git merge otherrepo/master --allow-unrelated-histories #merge otherrepo’s master branch to your local master branch
其他公司的回購更新後,您需要再次使用git pull otherreop
和git merge otherrepo/master --allow-unrelated-histories
。
完成所有事情後,您可以使用git checkout master
和git merge develop
將開發分支合併到主分支。