Interview Prep/Git & GitHub/Conflicts, remotes, fetch, pull and push

What are stages 1, 2 and 3 in the index during a conflict?

AdvancedConceptConflicts, remotes, fetch, pull and push
Answer

Git keeps three entries for an unmerged path: stage 1 is the common ancestor, stage 2 is "ours", stage 3 is "theirs". You can read them directly and use git mergetool or git checkout-index.

git show :1:app.py   # base
git show :2:app.py   # ours
git show :3:app.py   # theirs
git diff --base app.py
All Git & GitHub questions Roadmap: Git & GitHub

More on Conflicts, remotes, fetch, pull and push