When there\'s a merge conflict in Git, junk like the following is inserted into the conflicting files. Three questions:
When you have two branches with changes to the same file and you try to merge them, a merge conflict will occur. To see the list of conflicted files run git status
on your terminal.
Conflicted lines of the files will be marked with visual indicators:
<<<<<
- The conflict starts after this line.
=====
- Devides changes from HEAD and merging_branch.
>>>>>
- End of the conflicted lines.
<<<<<<< HEAD
conflicted text from HEAD
=======
conflicted text from merging_branch
>>>>>>> merging_branch
When you fix your conflicted files and you are ready to merge, all you have to do is run git add
and git commit
to generate the merge commit. Once the commit was made ,git push
the changes to the branch.
Reference article: Git merge.