谁能帮我这个,

我的文件夹结构是这样的:

Repo1 [Repository]
 |- branch1 [branch]

Repo2 [Repository]
 |-branch1 [branch]

现在我需要 merge 从 Repo1/branch1Repo2/branch1 的文件差异更改

我怎么做。我使用 git [bitbucket] 作为源代码管理。对于 GUI,我正在使用 sourcetree

谢谢,

克鲁蒂克

最佳答案

如果两个“存储库”都是同一个存储库的分支,这实际上很容易。如果它们是完全不同的存储库, merge 会变得有点困惑,但肯定是可能的。

基本步骤:

cd Repo2/branch1
git remote add Repo1 ../Repo1/branch1/.git
git fetch Repo1
git merge Repo1/branch1

这应该会触发常规的“git merge”场景。即使两个存储库实际上是 100% 独立的,Git 仍会进行 merge ,但无法自动 merge 文件之间的任何差异。

关于git - 将不同的代码更改从一个存储库分支 merge 到另一个存储库分支,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/21376489/

10-14 17:12
查看更多