Repository navigation
Closed
Description
couple of refinements in wt switch --help:
Branch name or shortcut
Opens interactive picker if omitted. Shortcuts: '^' (default branch), '-' (previous), '@' (current), 'pr:{N}' (GitHub PR), 'mr:{N}' (GitLab MR)
- I think these symbols should be using emphasis rather than
'? - we fail to list the PR link
Pull requests and merge requests
The pr:<number> / mr:<number> shortcut and the PR/MR's web URL both resolve to its branch. For same-repo PRs/MRs, worktrunk switches to the branch directly. For fork PRs/MRs, it fetches the ref (refs/pull/N/head or
refs/merge-requests/N/head) and configures pushRemote to the fork URL.
wt switch pr:101 # GitHub PR #101
wt switch https://github.com/owner/repo/pull/101 # ...the same PR, by URL
wt switch mr:101 # GitLab MR !101
wt switch https://gitlab.com/owner/repo/-/merge_requests/101 # ...the same MR, by URL
Both work anywhere a branch is accepted, including --base.
Requires gh (GitHub) or glab (GitLab) CLI to be installed and authenticated. The --create flag cannot be used with a PR/MR reference since the branch already exists.
Forks: The local branch uses the PR/MR's branch name directly (e.g., feature-fix), so git push works normally. If a local branch with that name already exists tracking something else, rename it first.
Gitea (experimental): pr: is also compatible with Gitea via the tea CLI. Set [forge] platform = "gitea" in .config/wt.toml to opt in; worktrunk also auto-detects Gitea when the remote host contains gitea or when tea
login add has been run for the host.
Azure DevOps (experimental): pr: is also compatible with Azure DevOps via the az CLI (with the azure-devops extension). Set [forge] platform = "azure-devops" in .config/wt.toml to opt in; worktrunk also auto-detects
Azure DevOps from dev.azure.com and *.visualstudio.com remotes.
- this is really "patchy" re Gitea / Azure. Instead, consolidate all notes about the different forges into a small comment at the bottom "Requires gh (GitHub), glab (GitLab) CLI, or equivalent to be installed and authenticated. See [wherever our help about the different forges is, probably in a
wt confighelp subcommand?!] for details." (e.g., feature-fix)totally superfluous (also look for other parenthesized items like this in--helps and remove them- so it should finish with
Forks: The local branch uses the PR/MR's branch name directly (e.g., feature-fix), so git push works normally. If a local branch with that name already exists tracking something else, rename it first., and make this more prose-like; open with "if the PR is on a fork...", and don't use the imperative, use a descriptive mood; "it requires renaming"
Metadata
Metadata
Assignees
Labels
No labels
Activity
worktrunk-bot commentedon Jun 16, 2026
Picked these up in #3096:
[BRANCH]arg blurb now use backtick emphasis (rendered as bold), matching how--basealready documented them.[BRANCH]arg label so the short help acknowledges the URL form too.(e.g., feature-fix).Requires gh/glabline into one footer pointing at the forge platform docs.I left the other
(e.g., …)parenthetical in this section (Switching to a remote branch (e.g., wt switch feature when only origin/feature exists) creates a local tracking branch.) alone since it felt like it was clarifying what "remote branch" means rather than restating something obvious — happy to drop it if you'd rather. I didn't sweep the other commands' help pages this round.docs(switch): refine wt switch --help text (#3096)