git fetch origin # download changes, DON'T merge yet
git fetch --all # fetch from all remotes
git pull # fetch + merge in one step
git pull --rebase # fetch + rebase (cleaner history)
git fetch is safe — it downloads remote commits into origin/main but doesn't touch your working files. You can inspect before merging:
git fetch
git log HEAD..origin/main --oneline # what's new on remote?
git diff HEAD origin/main # what changed?
git merge origin/main # now bring it in
git pull = git fetch + git merge (or rebase) all at once.
git pull # start of day: get latest
# ... do your work ...
git push # end of day: share your work
A colleague has pushed a commit to origin/main. Use git pull to bring those changes into your local repo.
Click "Run" to execute your code.