git - 在给定 merge 提交 SHA1 的情况下,您如何查看/显示已完成的 git merge 冲突解决方案?

标签 git merge resolution conflict

当您解决冲突,然后暂存更改,然后执行 git diff 时,它会显示两列 + 和 -,一列用于“我们的”,一列用于“他们的”。给定 repo 的 git 历史记录中的 merge 提交,我如何查看由其他人完成的决议?在其他情况下,我以前见过它(我想是在 gitk 中),但我似乎无法为我拥有的这个 SHA1 确定它。

最佳答案

如果你知道 ref,那么 git show <MERGE_COMMIT>将向您显示 merge 提交的解决方案(如果有)。

对于日志,使用git log -p -cgit 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/

相关文章:

html - 使用静态分辨率缩放 Canvas 元素

git - 如何将开发分支 merge 到master中并忽略master中的更改?

git - git 子树推送失败,输出疯狂

windows - 在 git bash 将它们替换为 unix 工具后恢复 windows 命令提示符工具

git - 在 Windows 上为 Git 配置差异工具

wpf - WPF应用程序开始最大化,但屏幕分辨率与显示不匹配

ruby-on-rails - docker 下的 .gitignore 文件放在哪里?

git - rebase 结果与 merge 结果有何不同?

php - 如何根据 PHP 中的键值合并/组合/插入 2 个不同的数组

安卓应用程序启动器图标