0

我想查看 git 存储库之间的不同变更集。回购是相关的,但两者都不是另一个的直接来源。在 Mercurial 中,我只会做“hgcoming other-repo ”和“hg incoming other-repo ”。

4

1 回答 1

0

我假设您的意思是回购中两个分支之间的不同变更集。在 git 中,您将有几个额外的步骤。进入其中一个存储库并执行以下操作

git remote add other OTHER_REPO
git fetch other

现在,您可以根据要走的方向使用以下方法之一查看差异

# Similar to hg outgoing (changes which in your branch not in the remote) 
git log other/BRANCH_NAME..BRANCH_NAME

# Similar to hg incoming (changes in the remote not in your branch)
git log BRANCH_NAME..other/BRANCH_NAME
于 2012-09-21T21:23:37.637 回答