Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git blame while resolving merge conflicts

I often rebase a large open source project and there are merge conflicts where I need to figure out who made the change and when in order to decide as to which change to take. So generally what I do is that I go to both repos and look at the file and do a git blame. Is there a mergetool that will provide this info during conflict resolution. I would like to know who made and this change and when for each version. Right now I am using meld.

like image 963
Salil Surendran Avatar asked Dec 25 '16 08:12

Salil Surendran


People also ask

Who is responsible for merge conflicts?

Merge conflicts occur when multiple authors edit the same content or when one developer deletes a file while another developer was making changes on it. To solve this problem developers work in isolated branches. The git merge command is responsible for combining isolated branches and resolving conflicting edits.


1 Answers

Beside gitk, you can try git blame -L '/^<<<</,/^>>>>/' -- {filename}: this is not integrated to a mergetool, but can be done for all conflicted files first.
Then you launch mergetool.

like image 118
VonC Avatar answered Nov 15 '22 21:11

VonC