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

What is the difference between `git fetch` and `git pull`?

BeginnerConceptConflicts, remotes, fetch, pull and push
Answer

fetch downloads new objects and updates remote-tracking refs like origin/main without touching your branches or working tree. pull runs fetch and then integrates (merge or rebase) into the current branch. Fetch is always safe and lets you inspect first.

git fetch origin
git log HEAD..origin/main --oneline
All Git & GitHub questions Roadmap: Git & GitHub

More on Conflicts, remotes, fetch, pull and push