Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
---
source: tests/integration_tests/help.rs
info:
program: wt
args:
- step
- promote
- "--help"
env:
CLICOLOR_FORCE: "1"
COLUMNS: "500"
GIT_ALLOW_PROTOCOL: file
GIT_CONFIG_COUNT: "2"
GIT_CONFIG_GLOBAL: /nonexistent/wt/gitconfig
GIT_CONFIG_KEY_0: user.useConfigOnly
GIT_CONFIG_KEY_1: rerere.enabled
GIT_CONFIG_SYSTEM: /nonexistent/wt/gitconfig
GIT_CONFIG_VALUE_0: "true"
GIT_CONFIG_VALUE_1: "false"
LANG: C
LC_ALL: C
LLVM_PROFILE_FILE: "[LLVM_PROFILE_FILE]"
TERM: alacritty
WORKTRUNK_APPROVALS_PATH: "[TEST_APPROVALS]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_SYSTEM_CONFIG_PATH: "[TEST_SYSTEM_CONFIG]"
WORKTRUNK_TEST_BASH_INSTALLED: "0"
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_CODEX_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
WORKTRUNK_TEST_EPOCH: "1735776000"
WORKTRUNK_TEST_FISH_INSTALLED: "0"
WORKTRUNK_TEST_GEMINI_INSTALLED: "0"
WORKTRUNK_TEST_NUSHELL_ENV: "0"
WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"
WORKTRUNK_TEST_PARENT_SHELL: ""
WORKTRUNK_TEST_POWERSHELL_ENV: "0"
WORKTRUNK_TEST_POWERSHELL_INSTALLED: "0"
WORKTRUNK_TEST_PROBE_TIMEOUT_MS: "60000"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
WORKTRUNK_TEST_ZSH_INSTALLED: "0"
---
success: true
exit_code: 0
----- stdout -----
wt step promote - [experimental] Swap a branch into the main worktree[0m
Exchanges branches and gitignored files between two worktrees.[0m
Usage: [1m[36mwt step promote[0m [36m[OPTIONS][0m [36m[BRANCH][0m
[1m[32mArguments:[0m
[36m[BRANCH][0m
Branch to promote to main worktree[0m
Defaults to current branch, or default branch from main worktree.[0m
[1m[32mOptions:[0m
[1m[36m-h[0m, [1m[36m--help[0m
Print help (see a summary with '-h')
[1m[32mAutomation:[0m
[1m[36m--format[0m[36m [0m[36m<FORMAT>[0m
Output format[0m
JSON prints structured result to stdout after the promote completes. The mismatch warning still appears on stderr in JSON mode (safety signal).[0m
[default: text]
[possible values: text, json]
[1m[32mGlobal Options:[0m
[1m[36m-C[0m[36m [0m[36m<path>[0m
Working directory for this command
[1m[36m--config[0m[36m [0m[36m<path>[0m
User config file path
[1m[36m--config-set[0m[36m [0m[36m<toml>[0m
Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
[1m[36m-v[0m, [1m[36m--verbose[0m[36m...[0m
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
[1m[36m-y[0m, [1m[36m--yes[0m
Skip approval prompts
[1mExperimental.[0m Use promote for temporary testing when the main worktree has special significance (Docker Compose, IDE configs, heavy build artifacts anchored to project root), and hooks & tools aren't yet set up to run on arbitrary worktrees. The idiomatic Worktrunk workflow does not use [2mpromote[0m; instead each worktree has a full environment. [2mpromote[0m is the only Worktrunk command which changes a branch in an existing worktree.
[1m[32mExample[0m
[107m [0m [2m# from ~/project (main worktree)[0m
[107m [0m [2m[0m[2m[34mwt[0m[2m step promote feature[0m
Before:
[107m [0m [2m Branch Path[0m
[107m [0m [2m@ main ~/project[0m
[107m [0m [2m+ feature ~/project.feature[0m
After:
[107m [0m [2m Branch Path[0m
[107m [0m [2m@ feature ~/project[0m
[107m [0m [2m+ main ~/project.feature[0m
To restore: [2mwt step promote main[0m from anywhere, or just [2mwt step promote[0m from the main worktree.
Without an argument, promotes the current branch — or restores the default branch if run from the main worktree.
[1m[32mRequirements[0m
- Both worktrees must be clean
- The branch must have an existing worktree
[1m[32mGitignored files[0m
Gitignored files (build artifacts, [2mnode_modules/[0m, [2m.env[0m) are swapped along with the branches so each worktree keeps the artifacts that belong to its branch. Files are discovered using the same mechanism as [2mcopy-ignored[0m and can be filtered with [2m.worktreeinclude[0m.
----- stderr -----