Interview Prep/Git & GitHub/Merge and Rebase Problems

`CONFLICT (add/add): Merge conflict in README.md`

IntermediateTroubleshootingMerge and Rebase Problems
Answer

Likely causes → Both branches created the same path independently (typical for the initial README or .gitignore).

Diagnose → git diff --diff-filter=U and git show :2:README.md, git show :3:README.md (stage 2 is ours, stage 3 is theirs).

Fix → Merge the two versions by hand, or choose one with git checkout --ours README.md / --theirs, then git add README.md and continue.

Prevent → For new repos, create the remote repo empty, or clone it first.

All Git & GitHub questions Roadmap: Git & GitHub

More on Merge and Rebase Problems