What is the difference between git fetch and git pull?
beginner 0–2 yrs
git fetch downloads new commits and updates remote-tracking branches like origin/main without touching your working branch. git pull runs a fetch and then integrates the changes into the current branch, by merge by default or by rebase if configured. Fetching first lets you inspect before integrating.
Full answer with examples