Branches and remotes
Sync (pull, then push)
2 min read
Sync combines the two everyday operations: it brings in what arrived on the remote and sends what you did. It's the button for the end of a task, when you want the branch to be the same on both sides.
- The repository bar: the Sync button, next to Push. The tooltip shows the pull mode in use, for example "Sync: Pull (fast-forward if possible), then push".
- The repository bar: the Pull arrow (Pull options) › Sync (pull, then push).
- Palette (Ctrl+P): "Sync: pull, then push" (detail: "Pull in your preferred mode and push whatever is left").
The button is disabled with a detached HEAD.
- With the branch checked out, click Sync.
- Versora pulls in the default mode, with pull autostash if it's on.
- If after the pull the branch still has commits the remote doesn't have, Versora pushes. The push checks run as usual.
- If there's nothing left to send, "main is up to date with origin/main: nothing to push." shows up.
| Situation | What Sync does |
|---|---|
| A branch with an upstream, behind and ahead | pull and then push |
| A branch with an upstream, only behind | pull; says there's nothing to send |
| A branch with an upstream, only ahead | pull (no change) and push |
| A branch without an upstream (or with the upstream removed) | only the push, which opens Publish branch |
| A pull with a conflict or refused | stops at the pull: the push doesn't happen |
| Detached HEAD | "You're on a detached HEAD: check out a branch to sync." |
git pull --no-rebase --ff --no-edit # or --ff-only / --rebase, depending on the default mode
# (+ --autostash, if on)
git push # only if there are local commits left
Ctrl+Z undoes the pull part ("Pull"): the branch goes back to the previous commit. The push isn't undone (see Push).
- In Pull (fast-forward only) mode, a branch that diverged makes the pull refuse, and Sync stops there. Change the mode or rebase first.
- The same messages as for pull and push apply here.
- Preferences › General › Remotes › Default pull mode: the mode Sync uses.
- Preferences › Operations › Autostash › On pull (and Sync).