fetch Without Merging
git fetch downloads new work but does not change your branch. Compare with origin/main.
Example
echo one > a.txt && git add a.txt && git commit -qm 'first'
git init -q --bare -b main ../r.git && git remote add origin ../r.git && git push -q -u origin main
cd ..; git clone -q r.git o; cd o
echo two >> a.txt && git commit -qam 'upstream' && git push -q
cd ../repo && git fetch -q
git log main..origin/main --format=%sResult
upstream
Exercise
Download only.
git Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.