Git: How to Handle Merge Conflicts
Resolve a Merge Conflict
Identify Conflicts
git status shows files with conflicts after a failed merge.
Open the Files
Look for <<<<<< / ====== / >>>>>> markers — your changes vs theirs.
Edit & Stage
Pick the right code, remove markers, git add the file.
Complete the Merge
git commit finalizes the merge with the resolved content.
Noble Desktop's Full-Stack Web Development Certificate teaches Git alongside the modern web stack — a must for any developer.
When you merge two branches (or merge a local and remote branch) you can sometimes get a conflict. For example, you and another developer unknowingly both work on the same part of a file. The other developer pushes their changes to the remote repo. When you then pull them to your local repo you'll get a merge conflict. Luckily Git has a way to handle conflicts, so you can see both sets of changes and decide which you want to keep.