Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find which merge strategy has been used for a merge commit?

Tags:

git

git-merge

Let's take a simple example, where I merge a topic branch into master using the merge strategy "ours". This merge creates the H commit, and after I do some other commits.

      A---B---C topic
     /         \
D---E---F---G---H---I---J---K master

I would like to know, if it is possible to determine afterwards which merge strategy was used on the commit H ?

like image 483
etiennepeiniau Avatar asked Oct 06 '22 05:10

etiennepeiniau


1 Answers

No, that’s not possible – git does not store such metadata. You can store such information in the commit message, but that’s completely up to the user.

You can make a good guess about the merge strategy by looking at how the conflicts where resolved:

git log -p -c -1 YOURMERGE
like image 116
Chronial Avatar answered Oct 13 '22 11:10

Chronial