How to check if a merge commit contains manual changes (e.g. resolved conflicts)?

流过昼夜 提交于 2020-12-25 03:52:35

问题


How can I find out if there were conflicts when merging a branch and what shenanigans did the person have to do to resolve those conflicts?

git log -p seems to show empty diffs for all merge commits, regardless whether they have manual changes or not.


回答1:


git show produces a combined diff for a merge commit by default, which will contain only the lines that changed as part of the conflict resolution.

git show <merge_commit_sha1>

git log takes the --cc option to produce combined diffs for merge commits. For example, to find all merge commits with manual changes you can use:

git log -p --cc --min-parents=2

and look for commits with diffs.



来源:https://stackoverflow.com/questions/45253550/how-to-check-if-a-merge-commit-contains-manual-changes-e-g-resolved-conflicts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!