Domdhi logoDOMDHI.OS
BACK_TO_COURSE

Working With Remotes & Not Breaking Prod

Clone, Fetch, Pull, Push — What's Actually Happening

Your Local Repo Doesn't Know Anything Changed Until You Ask

A remote (like GitHub) is just another copy of the repo living somewhere else. Your local git has no live connection to it — it only knows what it last checked.

git clone <url>       # copy a remote repo down, once
git fetch             # download new commits from the remote, WITHOUT touching your working files
git pull              # fetch + merge (or rebase) into your current branch, in one step
git push              # upload your local commits to the remote
git push -u origin feature-x   # push AND set up branch tracking (only needed once per branch)

git fetch is the safe one — it just updates git's knowledge of the remote. git pull actually changes your working files, which is why "just pull" without knowing what's incoming is how surprise merge conflicts happen mid-standup.

INFO

"Origin" isn't a keyword — it's just the default nickname git gives the remote you cloned from. You can have multiple remotes (origin, upstream, a coworker's fork) with any names you want.

QUIZ

What's the practical difference between `git fetch` and `git pull`?

Sign in to track lesson progress and earn a certificate.SIGN IN TO SAVE PROGRESS