Interview Prep/Git & GitHub/Merge and Rebase Problems

Production failed to start, and the file contains `<<<<<<< HEAD` lines that were committed.

BeginnerTroubleshootingMerge and Rebase Problems
Answer

Likely causes → Conflict markers were left in the file, staged with git add ., and committed without anyone reading the diff.

Diagnose →

git grep -nE '^(&lt;&lt;&lt;&lt;&lt;&lt;&lt;|=======|>>>>>>>)( |$)'
git log -S'&lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD' --oneline -- path/to/file

Fix → Resolve the file by hand (use git show &lt;merge-sha>^1:path and ^2:path to see both sides), commit the fix, and deploy. If it is on shared main, fix forward quickly.

Prevent → Use the check-merge-conflict pre-commit hook and run linters and tests in CI before merge.

All Git & GitHub questions Roadmap: Git & GitHub

More on Merge and Rebase Problems