Interview Prep/Git & GitHub/Merge and Rebase Problems

You merged `main` locally, but the PR on GitHub still says "This branch has conflicts that must be resolved."

IntermediateTroubleshootingMerge and Rebase Problems
Answer

Likely causes → You merged a stale local main (not origin/main), you did not push, main moved again, or the PR's base branch is not main.

Diagnose →

git fetch origin
git log --oneline HEAD..origin/main     # still missing commits?
git status -sb                          # ahead/behind your upstream

Check the PR's base branch at the top of the PR page.

Fix → git merge origin/main (or rebase), resolve, push. For the web editor, use "Resolve conflicts" for simple text conflicts.

Prevent → Always merge origin/main after git fetch, not a local main that may be old.

All Git & GitHub questions Roadmap: Git & GitHub

More on Merge and Rebase Problems