混帐合并不同的存储库?

我一直在为我的所有项目使用SVN。 有时项目B是作为项目A的副本发起的。当项目A有一个通用更改时,我可以在目录B中使用svn merge A ,并且它将合并这些更改。

现在,如果我想使用git。 我不喜欢将我的所有项目放在同一个存储库中,因为我必须克隆所有项目,不能像SVN那样选择一个项目。 但是每个项目都有一个存储库,我如何像以前一样使用SVN做同样的事情?

问题是:如果我想要几个子项目真正涉及到一个原始项目并保持同步,那么构建它的最佳方式什么? 而且我也希望能够单独检查它们


如果你有两个项目, proj1proj2并且想将proj1变化合并到proj2 ,你可以这样做:

# in proj2:
git remote add proj1 path/to/proj1
git fetch proj1
git merge proj1/master # or whichever branch you want to merge

我相信这和你在SVN中所做的一样。

链接地址: http://www.djcxy.com/p/46969.html

上一篇: git merge different repositories?

下一篇: Merge two Git repositories without breaking file history