Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tool for solving "trivial conflicts" in git

Tags:

git

git-merge

Do you know any tool/switch for git commands which help me prevent conflicts or speed up merges?

Currently I often got "trivial conflicts" such this:

++<<<<<<< HEAD
++=======
+ onClick
+ onWakeup
++>>>>>>> 587f917... 

I suppose that that is caused by some white-spaces.. this is very easy to solve by human, however it requires a lot of time to resolve all such conflicts.

Is there any tool which can solve this type of conflicts automatically?


PS. I am still learning English, however sometimes I am making stupid mistakes. I am doing my best, writing questions and answers in English, however I would be very glad if you will edit my post in case of any mistakes. I promise, your effort will not be wasted.

like image 880
noisy Avatar asked Oct 04 '10 11:10

noisy


People also ask

How do I use Git Mergetool to resolve conflicts?

We can manually resolve the merge conflict by editing the content in the bottom pane, and then saving the file using :wqa (Write and Quit all files). Once the conflict resolution is successful, the merged file will be staged for commit. git commit -m 'Merged from multiple branches' .


1 Answers

Run git-mergetool to resolve merge conflicts. See the man page here. Git has several options for merge tools. I prefer kdiff3. It's open-source, cross-platform, and easy to learn.

Git resolves as many conflicts as it can. If you get that message, it means git found a conflict that requires human intervention to resolve.

like image 106
dgnorton Avatar answered Nov 09 '22 01:11

dgnorton