git pull Fetch from a remote and update your branch
Downloads new commits for the branch you are on and combines them into it. It is git fetch followed by git merge, or by git rebase if you ask for that.
Synopsis
git pull [OPTION]... [REMOTE [BRANCH]]
Common options
| Option or form | What it does |
|---|---|
--rebase | Replay your local commits on top instead of making a merge commit |
--ff-only | Only update if it can be a clean fast-forward |
--no-rebase | Merge, even if your settings say rebase |
-p, --prune | Also prune deleted remote branches |
--autostash | Stash local changes first and reapply them after |
Examples
git pull
Updating 8b1d7e4..3f2a9c1
Fast-forward
app.js | 4 ++--
git pull --rebase
git pull --ff-only
git pull upstream main
git config --global pull.rebase true
Notes
- If your branch and the remote have both moved, pull may create a merge commit or stop with conflicts. Run git status to see.
- Commit or stash your changes first, or use --autostash.
- Newer Git versions warn if you have not chosen merge or rebase. Set pull.rebase or pull.ff once to stop that.
See also
Last reviewed 2026-10-09.