-3
  1. How do I merge conflicting classes in git?

  2. Is it recommended to merge conflicts in an IDE such as Eclipse or use something like Git Bash?

An Example to merge two conflicting classes with commands will be very helpful

briantaurostack7
  • 893
  • 2
  • 12
  • 34

2 Answers2

1

Hello @briantaurostack7!

I don't like the way how eclipse deal with git conflicts. I recommend in this case an use of a tool that can handle this conflicts.

If you use Windows i recommend source tree:

https://www.sourcetreeapp.com/

or git kraken for(Windows, Linux, MAC):

https://www.gitkraken.com/

Git Kraken comes with a lot of cool configuration options, where you can configure a tool for merge conflicts. At this point, you can use KDiff tool or beyond compare.

If any conflicts are detected on merge step, git kraken automatically list all conflicts for you and with one click, you can open the conflict on your merge editor and solve it. :)

Erik Paula
  • 69
  • 7
1

I usually recommend to do the simple commit workflow (add/commit) in "git gui", but resolve merge conflicts in your usual editor of choice. In my opinion, the difficult thing about merge conflicts is not the "editor" part, but finding a good resolution in cases where two developers actually meant to do something of substance with that piece of code. I have not yet seen any GUI which helps with finding that. A GUI that would make it easy to pick one or the other solution would lead to frequent misclicks / wrong decisions, I believe.

I find that when people have difficulty resolving merge conflicts, the problem always is that they don't understand the problem (what is a merge conflict; what does the presentation with <<<, ===, >>> mean exactly; what is the deeper reason for the current conflict; what was the intention of the two developers). The GUI part is trivial, in comparison.

Note that I do absolutely tell people to use a graphical tool for "git add" - mainly to be able to easily and quickly pick or reject single lines and blocks of code, which is stupendously slow on the command line, if you ask me. There is no "deep" thinking involved here, usually, anyways, which is the difference for merges.

AnoE
  • 6,874
  • 1
  • 14
  • 28