Pull the latest changes from origin
The simplest use: update your current branch from its tracked remote branch.
git pullMake sure you're on the right branch before pulling. Run `git branch` to confirm.
git pull keeps your local branch in sync with the remote. This tutorial explains what pull actually does (fetch + merge or rebase), when to prefer git fetch, and how to handle conflicts that arise during a pull.
A teammate pushed new commits. You run `git pull` and end up with a merge commit in your history that you didn't expect — or worse, a conflict that you don't know how to handle.
git pull is how you stay in sync with your team. But it does more than just download code — it also merges (or rebases) the remote changes into your local branch. Understanding what it does under the hood saves you from unexpected merge commits and conflicts.
Common mistakes developers make with this:
Gitoryx: Gitoryx shows you exactly how far your branch is behind origin before you pull, and lets you choose to pull with merge or rebase from the toolbar.
`git pull` is a shortcut for `git fetch` followed by `git merge` (or `git rebase`). It downloads new commits from the remote and integrates them into your current local branch.
The simplest use: update your current branch from its tracked remote branch.
git pullMake sure you're on the right branch before pulling. Run `git branch` to confirm.
Explicitly specify remote and branch when you want to pull from something other than the default.
git pull origin mainBy default, `git pull` creates a merge commit. Using `--rebase` re-applies your local commits on top of the incoming ones, giving you a linear history.
git pull --rebase origin mainSet rebase as the default pull strategy: `git config --global pull.rebase true`
If you want to see what's on the remote before integrating it, use `git fetch` and inspect the diff first.
git fetch origin
# See what's new on the remote
git log origin/main..HEAD # your local commits not on remote
git log HEAD..origin/main # remote commits not on your local
# Now merge when ready
git merge origin/main
See this workflow in Gitoryx. See how many commits you're behind origin at a glance
Free downloadIf there's a conflict, Git pauses the merge and marks the conflicted files. Resolve them, stage the files, then complete the merge.
git pull
# CONFLICT (content): Merge conflict in src/app.ts
# Edit the file to resolve the conflict, then:
git add src/app.ts
git commitDon't run `git pull` with uncommitted changes — Git may refuse or produce unexpected results. Commit or stash first.
Changed your mind? You can abort the in-progress merge and return to the pre-pull state.
git merge --abortGit may refuse the pull, or partially apply changes leading to a confusing state.
Fix: Commit your work or stash it (`git stash`) before pulling.
Every pull creates a 'Merge branch main of origin/main' commit, cluttering the history.
Fix: Use `git pull --rebase` to integrate remote changes without merge commits.
`git fetch` is safe — it only updates remote tracking branches. `git pull` fetches AND integrates, potentially creating conflicts.
Fix: Use `git fetch` when you want to inspect changes first, `git pull` when you're ready to integrate.

`git fetch` downloads remote changes and updates remote tracking branches (like `origin/main`) but does not touch your local branch. `git pull` does a fetch then automatically merges (or rebases) into your current branch.
Use `git pull --rebase`. This re-applies your local commits on top of the remote commits, resulting in a linear history with no merge commit.
Open the conflicted files, resolve the conflict markers (`<<<<<<<`, `=======`, `>>>>>>>`), stage the resolved files with `git add`, and then run `git commit` to complete the merge.
Not directly. You need to switch to that branch first, then pull. Alternatively, use `git fetch` to update the remote tracking branch without switching.
Everything in this tutorial is faster and clearer with a visual Git client. Gitoryx is free, runs natively on macOS, Windows, and Linux, and built for developers who want to move fast without breaking things.