What is the difference between `git pull` and `git fetch`?
⚡
Quick Answer
git fetch downloads new commits and refs from the remote but does not change your working branch. git pull does a fetch and then merges (or rebases) those changes into your current branch.
Detailed Answer
fetch is safe and non-destructive — it updates your remote-tracking branches so you can inspect what changed before integrating. pull = fetch + merge (or fetch + rebase with --rebase), which can create merge commits or replay your work. Many teams prefer fetch then review, or pull --rebase for a linear history.
💡
Interview Tip
Say pull = fetch + merge, and that fetch lets you review before integrating — showing you value safe, deliberate updates.
gitpullfetch