Branches and remotes
Pull and pull modes
4 min read
Pull fetches from the upstream and combines what arrived into your branch. How it combines depends on the pull mode: fast-forward if possible (with a merge commit when needed), fast-forward only, or rebase. The Pull button on the bar shows, in a badge, how many commits the branch is behind its upstream.
- The repository bar: the Pull button. The tooltip shows the default mode, for example "Pull (fast-forward if possible)".
- The repository bar: the arrow next to Pull (Pull options), with:
- Fetch all remotes;
- the three modes, with ● on the default mode and ○ on the others;
- the pull without hooks in the default mode (for example, Pull (fast-forward if possible) without hooks);
- Sync (pull, then push).
- The current branch's menu: the first item is the pull in the default mode.
- Palette (Ctrl+P): "Pull" (the detail shows the default mode) and one item for each mode, with the detail "Pulls in this mode and makes it the default".
| Mode | When the local branch has no commits of its own | When both have moved |
|---|---|---|
| Pull (fast-forward if possible) | moves the branch forward (fast-forward) | creates a merge commit |
| Pull (fast-forward only) | moves the branch forward | refuses: nothing changes |
| Pull (rebase) | moves the branch forward | redoes your commits on top of the ones that arrived |
Choosing a mode on the arrow pulls in that mode and makes it the default: the Pull button, Sync and the menu item then use that mode.
- With the branch checked out (for example,
main), click Pull. - The bar shows "Pulling…", git's phase and the percentage. Cancel interrupts it.
- If the mode is "fast-forward only" and the histories diverged, git refuses and nothing changes. Use another mode or rebase.
- If the pull's merge or rebase runs into a conflict, the operation stops and you resolve it in the conflict editor (see Conflicts).
git pull --no-rebase --ff --no-edit # Pull (fast-forward if possible)
git pull --ff-only # Pull (fast-forward only)
git pull --rebase # Pull (rebase)
# with pull autostash on in Preferences, the app adds --autostash
Without autostash on in Versora, whatever is in your git applies (rebase.autoStash,
merge.autoStash). See Autostash.
Ctrl+Z undoes "Pull": your branch goes back to the commit before the pull. The remote branches stay updated (the fetch isn't undone). A pull stopped at a conflict is settled with Continue or Abort: while it's stopped, Ctrl+Z doesn't undo the pull. Once you finish it (with Continue, through the commit box or, in a merge, with Finish the merge without hooks), Ctrl+Z undoes the whole pull ("Pull"), as if it had never stopped.
A local branch that isn't checked out can also be updated, as long as it's only behind its upstream. The working directory and the current branch don't change.
- The menu of a local branch that isn't the current one: Pull (fast-forward). It's disabled when the branch has no upstream.
- In a commit's menu, each local branch's submenu also has the item.
- Right-click
develop(withfeature/loginchecked out). - Choose Pull (fast-forward).
- The bar shows "Pulling develop…".
git fetch --prune --tags origin
git fetch . refs/remotes/origin/develop:refs/heads/develop
The second command only moves develop forward if it's a fast-forward. If develop has commits the
remote doesn't have, git refuses: check it out and use the regular pull.
Ctrl+Z undoes "Pull develop": the branch goes back to the previous commit.
Pull (fast-forward if possible) without hooks (or whichever mode is the default) and the "Pull without hooks" palette item pull without running the merge or rebase hooks. When a hook refuses a pull, the notice offers Try without hooks. See Skip hooks.
- "Pull isn't available in detached HEAD.": check out a branch.
- A refusal in "fast-forward only" mode (git says it can't fast-forward): the local branch and the remote diverged. Choose Pull (rebase) or Pull (fast-forward if possible).
- "The operation stopped because there are conflicts in 2 files.": resolve each file in the "Conflicted" section and click Continue, or Abort to give up.
- Local changes that would be overwritten: git refuses the pull. Turn on pull autostash, commit or stash first.
- "Tip: add this server's credential under "Git servers" (key icon).": the server refused the authentication.
- A branch without an upstream: git doesn't know where to pull from. Set the upstream (see Upstream).
- Preferences › General › Remotes › Default pull mode ("What the Pull button does. The other modes are still available from the arrow next to the button."). Default: Pull (fast-forward if possible).
- Preferences › Operations › Autostash › On pull (and Sync) (off by default).