How git pull Works (Fetch + Merge)
git pull downloads new commits from a remote branch and immediately merges them into your current local branch.
Published September 27, 2026
git pull downloads new commits from a remote branch and immediately merges them into your current local branch.
Key points
- It is equivalent to running git fetch followed by git merge
- git pull --rebase fetches and rebases your local commits on top instead of creating a merge commit
- A pull can produce merge conflicts if both you and the remote changed the same lines
Example
git pull origin main