Skip to content
Versora

Manual

Branches and remotes

Sync (pull, then push)

2 min read

On this page

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.

Where to find it

  • 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.

Step by step

  1. With the branch checked out, click Sync.
  2. Versora pulls in the default mode, with pull autostash if it's on.
  3. If after the pull the branch still has commits the remote doesn't have, Versora pushes. The push checks run as usual.
  4. If there's nothing left to send, "main is up to date with origin/main: nothing to push." shows up.

How it works in each case

SituationWhat Sync does
A branch with an upstream, behind and aheadpull and then push
A branch with an upstream, only behindpull; says there's nothing to send
A branch with an upstream, only aheadpull (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 refusedstops at the pull: the push doesn't happen
Detached HEAD"You're on a detached HEAD: check out a branch to sync."

What Versora does in git

bash
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

How to undo

Ctrl+Z undoes the pull part ("Pull"): the branch goes back to the previous commit. The push isn't undone (see Push).

Caveats and messages

  • 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).

See also