Git merging means taking changes from one context and combining it with your current working files. Most of the times git figures how to merge but there are few cases when you need to tell git what you do.
For example, when two people make changes to the same line in same file, when one person decides to delete while another person decides to manipulate the file etc.
try $git mergetool
It opens a GUI that helps you through every single step in resolving merge conflict.
The command does not open a GUI unless you've installed one.
set vimdiff as your default merge too using the following commands
$git config merge.tool vimdiff
$git config merge.conflictstyle diff3
$git config mergetool.prompt false
run the following command
$git mergetool
You'll see a vimdiff display
You can navigate between different views using ctrl+w and reach the MERGED view using ctrl+w-j
You could edit the MERGED view the following wa
-If you want to get changes from REMOTE
:diffg RE
-If you want to get changes from BASE
:diffg BA
-If you want to get changes from LOCAL
:diffg LO
Save, Exit, Commit and Clean up
:wqa save and exit from vi
git commit -m "message"
git clean Remove extra files created by diff tool.