git pull
intermediateFetch the remote and fold it into your current branch.
git pullWhat it does
git pull is two commands in one coat: a fetch (download remote objects + update remote-tracking refs) followed by a merge of those updates into your current branch. You can configure it to rebase instead of merge — either way your branch advances to include the remote work.
Your machine
local repository
Remote origin
everything.git
New objects travel down, then a merge integrates them into your branch
Watch it — press play
A narrated, step-by-step walkthrough that shows how to do it — not just theory. It adapts to the learner mode you picked in the top bar.
Step 1
Sync with the team
git pull fetches the remote's new work, then merges it into your current branch.
git pullYour machine
local repository
Remote origin
everything.git
Objects come down…
Under the hood
Fetch + merge (default)
git pull = git fetch (get origin/main's new commits as refs/remotes/origin/main) then git merge origin/main on your side. The merge may be a fast-forward or create a merge commit — same logic as any merge.
Fast-forward is the typical happy path
If you've made no local commits, pulling is a pure pointer move: your branch slides to the remote's tip. No merge commit, linear history preserved.
--rebase is the linearity savior
git pull --rebase fetches, then replays your local commits on top of the remote's without creating a merge bubble. Configure pull.rebase true and your branch history stays a clean train.
Divergence means conflict work
If both you and the remote changed the same lines, the pull stops with conflicts. Resolve → git add → git commit (or git rebase --continue with --rebase).
Aliases the pros type
Memorize the git pull concept, then let one of these shortcuts make it instant. Aliases are real git config keys — add one with:
git config --global alias.st # → git pull --rebaseg upgit pull --rebaseThe linear-history pull — rebase'd, no merge bubbles.
g plgit pullPlain pull shorthand.
g uffgit pull --ff-onlySync or loudly fail — perfect in scripts.
g glgit pull -rAnother popular rebase-pull alias.
Command anatomy
--rebaseReplay your commits on the remote's new base instead of merging.
--ff-onlyRefuse a non-fast-forward merge — fail rather than diverge.
--tagsAlso pull tags from the remote.
When to reach for it
Daily sync with the team: git pull before starting a workday block.
git pull --rebase main keeps your WIP branch linear against a fast-moving main.
git pull --ff-only when you want an explicit 'stay in sync, never diverge' discipline.
Pro tip
Set `git config --global pull.rebase true` and `pull.ff only` once, and git pull becomes a philosophical position: bring the remote together with your work, rebase locally, never surprised by a surprise merge commit.