当您解决冲突,然后暂存更改,然后执行 git diff 时,它会显示两列 + 和 - ,一列代表“我们的”,一列代表“他们的”。给定存储库的 git 历史记录中的合并提交,我如何查看由其他人完成的解决方案?在其他情况下,我以前见过它(我想是在 gitk 中),但我似乎无法确定我拥有的 SHA1。
如果你知道裁判,那么git show <MERGE_COMMIT>
将向您显示合并提交的已完成解决方案(如果有)。
对于日志,请使用git log -p -c
or 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.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)