Skip to content
Latchkey

git pull: Usage, Options & Common CI Errors

git pull is git fetch followed by an integration step (merge or rebase).

Pull updates your branch with remote changes. In CI you almost always want --rebase or --ff-only for predictable results.

What it does

git pull runs git fetch to get new commits, then merges (default) or rebases them onto your current branch.

Common usage

Terminal
git pull
git pull --rebase origin main
git pull --ff-only             # fail instead of creating a merge

Options

FlagWhat it does
--rebaseRebase local commits instead of merging
--ff-onlyOnly fast-forward; error if a merge is required
--no-rebaseForce a merge integration
--autostashStash/unstash dirty changes around the pull

Common errors in CI

fatal: Need to specify how to reconcile divergent branches - newer Git refuses to guess. Pick one: git config pull.rebase true (or pull.ff only). "Your local changes would be overwritten by merge" means a dirty tree; commit, stash, or use --autostash first.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →