Version Control · Flashcard

Why is git fetch safer than git pull mid-task?

  • AFetch only updates origin/*, leaving your branch and files alone
  • BFetch only reports what changed, downloading nothing until a merge
  • CFetch refuses to run while the working tree has uncommitted edits
  • DFetch keeps the new commits outside .git until you accept them

Why this is the answer

Fetch is read-only with respect to your work: it writes objects and remote-tracking refs, so you can inspect what arrived with git log main..origin/main before deciding to merge or rebase. It does download the objects (they land in .git immediately), and it happily runs with a dirty working tree because it never touches it.

Official docs
Study in Gnoseed →