tohava
tohava

Reputation: 5412

How to detect manually resolved conflicts in git

In my git repository, I had a file which someone merged by choosing their own version over the master version. He also changed the commit description and deleted the 'Conflicts:' part of its description. Is there any way that I can use git log or some other git command in order to see for a merge which commits were manually resolved, even though they were deleted from the commit description?

Note that I tried using the -c option in git diff and git log and it did not show the change.

I am attaching a pastebin that shows how to reproduce this: http://pastebin.com/rb75nR5J

Upvotes: 0

Views: 176

Answers (2)

user2030471
user2030471

Reputation:

You can use cat-file to list both the parents of a merge-commit:

$ git cat-file -p 531a6db50cd71f872d7d68b9c9cf5f9bbd9f6847
tree a35f8705115ca5e05a9e19f90473b7fded4b51e8
parent eb37b8f9e3e72eb170d3f968b9bc5ddc79d2db3b
parent cc0407d3c016600253b41b01f1bc6d1a6237bd7e

Upvotes: 0

CodeWizard
CodeWizard

Reputation: 141946

You can view list of merged files files using this command:
git log -U -m --simplify-merges --merges

This will print out the patch that was used during the conflict resolution.
--merges will print out only the merge commits (usually conflict will be resolved and committed into a merge commit)

You can also add the --first-parent to display merged commits only from the current branch

Upvotes: 1

Related Questions