Here is the scenario:
User A and B has the same source code. User A makes a changes => add => commit => push. The source code in remote repository is changed.
User B start changing without pulling. (or maybe changes in remote repository is applied after user B pulled the repository) Then he also wants to push. At this moment, conflict occurs. I searched a lot and couldn't find any solution, but to edit conflicts manually.
Question: Is editing conflicts manually an efficient way? Specially in a big project? What is the approach?
Managing merge conflicts manually can be a cumbersome task.
Try git mergetool
and it will open the default mergetool although you have to install a mergetool first.
There are several mergetools which can help you resolve conflict such as meld
, opendiff
, kdiff3
, tkdiff
, xxdiff
, tortoisemerge
, gvimdiff
, diffuse
, ecmerge
, p4merge
, araxis
, vimdiff
, emerge
.
After installing it just execute and it will open the installed mergetool, it will provide you with a gui that will steps you through each conflict, and you get to choose how to merge.
If you use IDEs like IntelliJ they provide and inbuilt tool to fix merge conflicts.