Skip to main content
>_ supraj.dev
TOPIC GIT
Remotes & Tracking your copy vs everyone's copy
IN 10 SECONDS

A remote is a copy of your project hosted on a shared server (GitHub/GitLab). Local tracking branches keep track of remote branch pointers (origin/main) to synchronize changes.

GOTCHA Git pull is a shortcut for git fetch + git merge. Use git pull --rebase to keep histories linear and avoid merge commits.
HOW COLLABORATIVE SYNC FLOWS
01 Git fetch pulls down remote updates, updating origin/main pointer.
02 Diff status checks: is local main ahead or behind origin/main?
03 Git pull fetches remote updates and merges them into your active branch.
04 Git push pushes local commits up to remote, advancing remote pointers.
POKE IT YOURSELF
git remote -v — list all configured remote repositories
git fetch --all — download remote histories without changing local branch files