There are several ways to solve git conflicts, I will explain here using GUI and text editor way.
Solving git conflict using text editor.
Open any one of your favourite editor, example, Notepad, gedit, vim, nano or even Eclipse.
Whenever there is conflict in a file git add conflict marker that looks like this <<<<<<<<
.
When you open the file in your text editor, you'll see the changes from the HEAD or base branch after the line <<<<<<< HEAD
========
, it divides your changes from the other branch as >>>>>>>>YOUR_BRANCH_NAME
You can decide if you want keep your branch changes or not. If you want to keep the changes what you did, delete the conflict marker they are,<<<<<<<, =======, >>>>>>>
and then do a merge.
Commands to commit the changes.
git add . or git add "your_file"
git commit -m "Merge conflicts resolved"
Solving git conflict your GUI
What if you have so many merge conflicts in files? In that case you can use GUI, well its just personal choice whether to opt for GUI or not. In GUI, you can see side by side diff. It is easy for the beginners to see the changes.
You need to configure your git to use the mergetool you want to use. Example: meld, kdiff3 or vimdiff. Again it's upto the user what they prefer. I use meld. Here you need to install these tool, after installation you have to configure it.
git config merge.tool meld
you can solve merge conflicts
git mergetool -t meld
Then you can follow the step 2 to 4 from solving using text editor, to solve the merge conflicts.
git status
list any files which "both" sides modified? Are you certain that you are looking at the right file, and that you searched the whole file for the conflict markers?