Search code examples
gitgit-mergegit-merge-conflict

View date of last commit from each branch affecting merge conflict


When I have a merge conflict like:

<<<<<<< HEAD
    some code
=======
     other code
>>>>>>> branch-name

is there a way to see date of last commit that affected some code and date of other commit that last affected other code?


Solution

  • Yes, run git blame on both branches you're merging.

    If the conflict is on some.txt and you're merging A into B you'd run git blame A -- some.txt and git blame B -- some.txt. That will tell you the commit ID, author, and date of the last change to the lines.