git中对应svn:mergeinfo的是什么?

5

我在git中缺少干净的合并信息:

  • 哪些提交(包括注释)已被一个提交合并
  • 哪些提交未被一个提交合并。

我该如何获取这些信息?在SVN中,有非常有用的合并信息概念。


你尝试过使用 git log branch_point..merge_point 的变体(或者使用带范围的 git show)吗?据我所知,Git 没有将分支的一系列修订版本合并的概念(如果需要,请使用 git cherry-pick),因此 svn mergeinfo 所做的似乎在 Git 中有些多余。 - Benjamin Bannier
2个回答

4
我不确定您想要解决的具体情况是什么。
  • You can list the commits from branch foo that are not yet merged into branch bar using:

    git log bar..foo
    
  • You can list all commits from any local branch that aren't merged into branch bar using:

    git log --branches --not bar
    
  • If you want remote branches, use --remotes. See git-rev-list(1) for more variations.

  • Perhaps this is what you want for seeing what commits were new since the common ancestor of both parents of a merge, although I don't think the question is clear:

    git log <merge-commit>^1...<merge-commit>^2
    
  • You can see which commits are cherry-picked between two branches using git cherry.


看起来很有前途,你能不能确认一下是否缺少了一个“不”字? - Chris

1

对于完整的SVN分支合并,Git的等效操作是完整的Git分支合并(即存在具有多个父级的合并提交)。

对于SVN cherry-pick,没有严格的等效操作。但是,如果您使用git cherry-pick命令,则可以保留提交消息。我个人使用此提交消息来确定更改是否存在于某个分支中。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接