Skip to main content

rt sync

rt › sync

Quick rebase your branch and auto-resolve trivial conflicts

Usage​

bash
rt sync [flags]

Arguments & flags​

Flag / ArgTypeDefaultDescription
--dry-runbooleanfalseShow what would happen without doing it
--jsonbooleanfalseOn conflict, emit a JSON conflict bundle and exit 3 instead of prompting; on a stack member, or when the stack check cannot run, emit a JSON refusal and exit 4 before touching anything
--agentbooleanfalseOn conflict, skip the prompt and hand off straight to a Claude agent in herdr (requires a TTY)
--no-agentbooleanfalseOn conflict, never offer agent escalation; abort instead
--progressbooleanfalseWith --json, still print each step on stderr as it happens

Subcommands​

CommandDescription
allSync every worktree in this repo

See code: commands/sync.ts › syncCommand

Examples & notes​

How rt sync signs in​

Nothing to set up. rt sync fetches and pushes with git's own credentials first, so a clone that already works keeps working.

When git fails over HTTPS and rt holds a token for that host, rt tries once more through its own credential helper. The retry covers this run only, and rt writes nothing to your git config. After a clean run, a note says rt's token was used, and suggests rt git auth to make it permanent when that would go ahead on the clone. A git -c credential.helper=... above rt (an alias or a hook) turns the retry off, since that helper would see the token.

  • rt never asks for a password when it can sign in with its own token.
  • rt sends its token only to github.com, gitlab.com and your configured GitLab host, and never over http://.
  • An SSH failure says whether no key is loaded or the forge refused yours. When switching the clone to HTTPS would work, it offers rt git auth --https.
  • The stack check hands rt's token to glab and gh for the host it checks, pinned to origin's repo. For any other host, those tools use their own login.

rt sync all, rt git rebase and rt git reset sign in the same way.