A conflict means two branches changed the same lines. Git marks them inline — understand the markers, pick the right side deliberately, and finish the merge cleanly.
Git cannot decide which change wins. The markers show HEAD (your side), then the incoming branch (theirs).
modify/delete conflicts appear in git status as 'deleted by them' / 'deleted by us' — you must explicitly choose keep or remove with git add or git rm.
git status --short && git diff --name-only --diff-filter=U
grep -rn '<<<<<<<\|>>>>>>>' . --include='*' | head # find leftovers before staging
git checkout --ours path/file # or --theirs, then git add path/file
git add -A && git commit # or for a rebase: git rebase --continue
git merge --abort # restores pre-merge state exactly
IDE conflict tools (VS Code's merge editor) are safer than hand-editing for large files. git rerere (reuse recorded resolution) remembers your conflict resolutions across repeated rebases: git config rerere.enabled true.
<<<<<<< HEAD starts your current branch's version, ======= separates the two, and >>>>>>> branch names the incoming version. Delete the markers and keep whichever code is correct — often a mix of both.
Fix the file content, then amend the merge commit: git add file && git commit --amend. If already pushed, add a follow-up commit fixing the markers.
Our most-documented failures, packaged as ready-to-ship starter kits: Docker, Kubernetes, and Terraform.
Browse the template store →One-time. Yours to modify. Instant download from the NinjaOps template store.