我在git中缺少干净的合并信息:
- 哪些提交(包括注释)已被一个提交合并
- 哪些提交未被一个提交合并。
我该如何获取这些信息?在SVN中,有非常有用的合并信息概念。
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
.
对于完整的SVN分支合并,Git的等效操作是完整的Git分支合并(即存在具有多个父级的合并提交)。
对于SVN cherry-pick,没有严格的等效操作。但是,如果您使用git cherry-pick
命令,则可以保留提交消息。我个人使用此提交消息来确定更改是否存在于某个分支中。
git log branch_point..merge_point
的变体(或者使用带范围的git show
)吗?据我所知,Git 没有将分支的一系列修订版本合并的概念(如果需要,请使用git cherry-pick
),因此svn mergeinfo
所做的似乎在 Git 中有些多余。 - Benjamin Bannier