当您解决冲突,然后暂存更改,然后执行 git diff 时,它会显示两列 + 和 -,一列用于“我们的”,一列用于“他们的”。给定 repo 的 git 历史记录中的 merge 提交,我如何查看由其他人完成的决议?在其他情况下,我以前见过它(我想是在 gitk 中),但我似乎无法为我拥有的这个 SHA1 确定它。
最佳答案
如果你知道 ref,那么 git show <MERGE_COMMIT>
将向您显示 merge 提交的解决方案(如果有)。
对于日志,使用git log -p -c
或 git log -p --cc
.来自 git log 的联机帮助页:
-c
With this option, diff output for a merge commit shows the differences from each
of the parents to the merge result simultaneously instead of showing pairwise
diff between a parent and the result one at a time. Furthermore, it lists only
files which were modified from all parents.
--cc
This flag implies the -c option and further compresses the patch output by
omitting uninteresting hunks whose contents in the parents have only two
variants and the merge result picks one of them without modification.
关于git - 在给定 merge 提交 SHA1 的情况下,您如何查看/显示已完成的 git merge 冲突解决方案?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15277708/