6

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.

noisy
  • 6,495
  • 10
  • 50
  • 92

2 Answers2

2

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.

dgnorton
  • 2,237
  • 16
  • 12
  • 1
    yes, I understand, but in my opinion it can be quite obvious, that result of this (specific types of) conflict will be removing lines "++<<<<<<< HEAD", "++=======", "++>>>>>>> 587f917... ". I am looking for tool, which will do this automatically. – noisy Oct 04 '10 at 16:32
2

If you find yourself resolving the same conflicts again, and again, then you probably want to use git rerere.

cmcginty
  • 113,384
  • 42
  • 163
  • 163