Git: CONFLICT (content): Merge conflict in file
Fix Git merge conflicts when two branches modify the same lines in a file.
Git: CONFLICT (content): Merge conflict in file
Git reports a merge conflict when two branches modify the same lines in a file and automatic merging fails.
When Git Produces This Error
Git displays
CONFLICT (content): Merge conflict in {file} during
git merge,
git pull,
git rebase, or
git cherry-pick. The affected files contain conflict markers.
What Causes Merge Conflicts in Git
Two branches modified the same lines in the same file. Git cannot determine which version to keep automatically.
How to Fix Merge Conflicts in Git
Open each conflicted file and look for conflict markers (
<<<<<<<,=======,>>>>>>>).Edit the file to keep the correct content and remove all conflict markers.
Stage the resolved file:
git add resolved-file.txtComplete the merge:
git commit
For a detailed walkthrough, see How to resolve a merge conflict in Git.