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

What is the difference between `origin/main`, `main` and `FETCH_HEAD`?

IntermediateConceptConflicts, remotes, fetch, pull and push
Answer

main is your local branch, origin/main is a read-only snapshot of the remote's main taken at the last fetch, and FETCH_HEAD is a temporary ref holding what the most recent fetch retrieved (useful with git fetch origin pull/12/head).

git fetch origin pull/12/head && git switch -c pr-12 FETCH_HEAD
All Git & GitHub questions Roadmap: Git & GitHub

More on Conflicts, remotes, fetch, pull and push