Journeys · Git · L1
git push and git fetch
Your commit goes to origin, and Lakshmi's clone learns about it. Watch what each side says.
✓ Validated on Git 2.43.0 · Run 1 · 2026-11-21Preview
The 30-second answer
git push starts receive-pack in origin. It lists origin's branches first. Your git compares, then sends one line, old id, new id, branch, and a pack with the objects origin lacks. Origin stores them, moves main and reports ok. Your clone moves origin/main to match. git fetch starts upload-pack. They speak protocol version 2: Lakshmi's git asks for the refs, wants the new commit, lists the commits she has, and gets a pack with only what is missing. Her origin/main moves. Her main and her files do not.
Mental model
Two post offices. To send, the clerk at the far office first reads out every mailbox and its latest letter number. You ask to move mailbox main from letter 7a05869 to letter 8eab18c, and hand over the letters it is missing. To collect, you tell the far office which letters you want and which you have, and it sends only the rest.
Where the analogy breaks
A post office sends letters away. Git copies: your clone keeps every object it sent. And the receiving side unpacks a small delivery into one file per object, but keeps a large one as a pack.
🔒 Free account
Sign up free to play this journey
A free account unlocks every scenario, journey and exam, and saves your progress. No payment, ever.