sreenivas./courses
Git & GitHub for Beginners — all lessons
🔁

MODULE 03 · 6 MIN READ

Pull — when someone else moves first

You're not alone anymore. Press the 🧑‍💻 teammate pushes button in the GitHub panel above — a colleague just pushed a commit you don't have. Now make a commit of your own and try to push…

git bash

$ touch ideas.md

$ git add .

$ git commit -m "Add ideas"

$ git push

! [rejected] main -> main (fetch first)

GitHub has commits you don't — someone else pushed.

→ git pull (then push again)

$ git pull

Pulled 1 commit from origin ✓

$ git push

Pushed 1 commit → origin/main ☁️

Rejected! Git protects the remote: you can't push while you're missing someone else's work. The fix is always the same dance: pull first, then push. Pull brings their commit down and weaves it with yours — you know this machinery from yesterday's merges.

💻 YOUR LAPTOP

nothing here yet — git clone to begin
↑ push ·↓ pull (2 behind!)

☁️ GITHUB · origin/main

r1a2bInitial commit
r2b3cAdd about/TEMPLATE.md + my about file

🏆 THE TEAM — about/ on main

SSAI001 — instructor
practice terminal — you cannot break it

a tiny simulated laptop, wired up to a fake GitHub. clone to begin.

$ 

// click 🧑‍💻 teammate pushes above, then try: git clone ... → touch ideas.md → git add . → git commit -m "Add ideas" → git push → git pull → git push