Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Merging selective lines of code using Git?

I would like to force git to always merge using a (kind of) 3-way conflicts resolution. Moreover, I want to do it to the point of being able to choose single lines.

At the moment I am merging two branches. However, if possible, I'd like to know how to perform this task even when merging multiple branches.

like image 678
Alexander Avatar asked Nov 05 '22 08:11

Alexander


1 Answers

Git tries to do 3-way merging by default (the recursive strategy for 2 heads, and the octopus strategy for 3+ heads).

If you want to see 3-way resolution options when manually merging, try setting the merge.conflictstyle config option to diff3.

(See the Configuration section of the git-merge man page for details on that option.)

like image 147
Amber Avatar answered Nov 09 '22 13:11

Amber