Expand description
gwm sync (issue #24) — fetch + rebase / merge a worktree’s branch
onto its configured upstream.
The read-side inspection (dirty check, upstream resolution,
ahead/behind) goes through libgit2; the mutating steps (fetch,
rebase, merge) shell out to the git binary. That split is
deliberate: libgit2’s fetch needs the caller to wire credential
callbacks (SSH agents, tokens, helpers) to talk to a real remote,
whereas the user’s git already has all of that configured. The
existing sidebar previews (git_log_oneline, git_status_short)
shell out for the same reason, so this stays consistent.
Structs§
- Sync
Report - Outcome of a successful
syncrun. Conflicts, dirty trees, and missing upstreams surface asGwmErrorinstead — only the non-error paths produce a report.
Enums§
- Sync
Action - What
syncactually did once preconditions passed. - Sync
Strategy - How
gwm syncreconciles the local branch when it is behind its upstream. Defaults to rebase (linear history, the repo convention);--mergeopts into a merge commit instead.
Functions§
- sync
- Fetch
start’s upstream, then rebase (or merge) the local branch onto it.startmay be any path inside the target worktree — the repository is discovered upwards from it.