Skip to main content

Remotes and mutations

This page is fetch, pull, push, and branch switch for a workspace worktree. The Server runs the Git operations; clients only display the result.

  1. POST .../git/branch

    Switches to a local branch or creates a new branch from the current HEAD.

  2. POST .../git/checkout

    Creates a local tracking branch from a unique remote-tracking ref, or switches to the local branch when it already exists.

  3. POST .../git/fetch

    Runs git fetch --prune, optionally for one remote, with GIT_TERMINAL_PROMPT=0.

  4. POST .../git/pull

    Runs git pull --ff-only, or git pull --rebase when requested.

  5. POST .../git/push

    Runs git push, optionally --force-with-lease and -u.

Successful branch switch, remote checkout, and pull refresh the workspace registry's live branch and commit so sidebar and overview identity match HEAD. Remote mutations reuse the same per-workspace lock and reject while an ACP prompt is running.

Auth failures, a missing upstream, a non-fast-forward pull, a stale force-with-lease, and a dirty worktree switch return structured problem details rather than raw Git stderr.

Where it differs

Desktop

Branch switching lives on the Overview tab, not in the Git panel. Overview also hosts Fetch, Pull, Push, and a confirmed force-with-lease action, and lists remote-tracking branches beside local ones.

Mobile

Those same controls sit on the Git tab. Every fetch, pull, push, switch, remote checkout, and create-branch mutation asks for an explicit confirmation that names the branch or remote. Force-with-lease is offered only from the result of a rejected non-fast-forward push.