Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

Update docs and help text to clarify default branch references (#275)

Maximilian Roos3471fee63ba6
diff --git a/dev/config.example.toml b/dev/config.example.toml
index 2ab8bbb1d..fa06430b2 100644
--- a/dev/config.example.toml
+++ b/dev/config.example.toml
@@ -47,7 +47,7 @@ worktree-path = "../{{ main_worktree }}.{{ branch | sanitize }}"
# List Command Defaults
# Configure default behavior for `wt list`
[list]
-full = false # Show CI and `main` diffstat by default
+full = false # Show CI and default-branch merge-base diffstat (`main…±` column) by default
branches = false # Include branches without worktrees by default
remotes = false # Include remote branches by default
@@ -59,13 +59,14 @@ stage = "all" # What to stage: "all", "tracked", or "none"
# Note: `stage` defaults from [commit] section above
[merge]
squash = true # Squash commits when merging
-commit = true # Commit, squash, and rebase during merge
+commit = true # Commit uncommitted changes during merge (disables squash when false)
+rebase = true # Rebase onto target before merging
remove = true # Remove worktree after merge
verify = true # Run project hooks
# Approved Commands
-# Commands approved for automatic execution after switching worktrees
-# Auto-populated when you use: wt switch --execute "command" --force
+# Commands approved for project hooks in this repo
+# Auto-populated when you approve hooks (prompt on first run) or run: wt hook approvals add
[projects."github.com/user/repo"]
approved-commands = ["npm install"]
diff --git a/dev/wt.example.toml b/dev/wt.example.toml
index 55ffccdb4..43e481f6c 100644
--- a/dev/wt.example.toml
+++ b/dev/wt.example.toml
@@ -12,7 +12,7 @@
# {{ repo_root }} - Absolute path to the repository root
#
# Merge-related hooks also support:
-# {{ target }} - Target branch for the merge (e.g., "main")
+# {{ target }} - Target branch for the merge (e.g., "main" default branch)
#
# Filters:
# {{ branch | sanitize }} - Replace / and \ with - (e.g., "feature-foo")
@@ -76,7 +76,7 @@
# build = "cargo build --release"
# Post-Merge Hook
-# Runs SEQUENTIALLY in the main worktree after successful merge (blocking)
+# Runs SEQUENTIALLY in the worktree for the target branch if it exists, otherwise the main worktree (blocking)
# Runs after push and cleanup complete
# Use for: updating production builds, notifications, cleanup
#
diff --git a/docs/CLAUDE.md b/docs/CLAUDE.md
index 657e05529..a8127f69b 100644
--- a/docs/CLAUDE.md
+++ b/docs/CLAUDE.md
@@ -239,7 +239,7 @@ This expands during `--help-page` generation to:
**Use cases:**
- `wt config create` — Shows the actual config file templates (via `include_str!`)
-- `wt config var get` — Shows per-variable examples not in the parent
+- `wt config state marker` — Shows per-key examples not in the parent
All AUTO-GENERATED markers use a consistent format with START and END tags:
```html
diff --git a/docs/content/claude-code.md b/docs/content/claude-code.md
index 8641fd824..d23dfd2b1 100644
--- a/docs/content/claude-code.md
+++ b/docs/content/claude-code.md
@@ -42,14 +42,14 @@ $ claude plugin install worktrunk@worktrunk
Set status markers manually for any workflow:
```bash
-$ wt config var set marker "🚧" # Current branch
-$ wt config var set marker "✅" --branch feature # Specific branch
+$ wt config state marker set "🚧" # Current branch
+$ wt config state marker set "✅" --branch feature # Specific branch
$ git config worktrunk.state.feature.marker '{"marker":"💬","set_at":0}' # Direct
```
## Statusline
-`wt list statusline --claude-code` outputs a single-line status for the Claude Code statusline. This fetches CI status from the network (1-2 seconds), making it suitable for async statuslines but too slow for synchronous shell prompts. If a faster version would be helpful, please [open an issue](https://github.com/max-sixty/worktrunk/issues).
+`wt list statusline --claude-code` outputs a single-line status for the Claude Code statusline. This may fetch CI status from the network when the cache is stale (often ~1–2 seconds), making it suitable for async statuslines but too slow for synchronous shell prompts. If a faster version would be helpful, please [open an issue](https://github.com/max-sixty/worktrunk/issues).
<code>~/w/myproject.feature-auth !🤖 @<span style='color:#0a0'>+42</span> <span style='color:#a00'>-8</span> <span style='color:#0a0'>↑3</span> <span style='color:#0a0'>⇡1</span> <span style='color:#0a0'>●</span> | Opus</code>
diff --git a/docs/content/config.md b/docs/content/config.md
index 53c8a2342..6f08740aa 100644
--- a/docs/content/config.md
+++ b/docs/content/config.md
@@ -99,7 +99,8 @@ stage = "all" # "all" (default), "tracked", or "none"
[merge]
# These flags are on by default; set to false to disable
squash = false # Preserve individual commits (--no-squash)
-commit = false # Skip committing uncommitted changes (--no-commit)
+commit = false # Skip committing uncommitted changes (also disables squash)
+rebase = false # Skip rebase (fails if not already rebased)
remove = false # Keep worktree after merge (--no-remove)
verify = false # Skip hooks (--no-verify)
```
@@ -318,7 +319,7 @@ worktree-path = "../{{ main_worktree }}.{{ branch | sanitize }}"
# List Command Defaults
# Configure default behavior for `wt list`
[list]
-full = false # Show CI and `main` diffstat by default
+full = false # Show CI and default-branch merge-base diffstat (`main…±` column) by default
branches = false # Include branches without worktrees by default
remotes = false # Include remote branches by default
@@ -330,13 +331,14 @@ stage = "all" # What to stage: "all", "tracked", or "none"
# Note: `stage` defaults from [commit] section above
[merge]
squash = true # Squash commits when merging
-commit = true # Commit, squash, and rebase during merge
+commit = true # Commit uncommitted changes during merge (disables squash when false)
+rebase = true # Rebase onto target before merging
remove = true # Remove worktree after merge
verify = true # Run project hooks
# Approved Commands
-# Commands approved for automatic execution after switching worktrees
-# Auto-populated when you use: wt switch --execute "command" --force
+# Commands approved for project hooks in this repo
+# Auto-populated when you approve hooks (prompt on first run) or run: wt hook approvals add
[projects."github.com/user/repo"]
approved-commands = ["npm install"]
@@ -478,7 +480,7 @@ With `--project`, creates `.config/wt.toml` in the current repository:
# {{ repo_root }} - Absolute path to the repository root
#
# Merge-related hooks also support:
-# {{ target }} - Target branch for the merge (e.g., "main")
+# {{ target }} - Target branch for the merge (e.g., "main" default branch)
#
# Filters:
# {{ branch | sanitize }} - Replace / and \ with - (e.g., "feature-foo")
@@ -542,7 +544,7 @@ With `--project`, creates `.config/wt.toml` in the current repository:
# build = "cargo build --release"
# Post-Merge Hook
-# Runs SEQUENTIALLY in the main worktree after successful merge (blocking)
+# Runs SEQUENTIALLY in the worktree for the target branch if it exists, otherwise the main worktree (blocking)
# Runs after push and cleanup complete
# Use for: updating production builds, notifications, cleanup
#
@@ -622,7 +624,7 @@ Use `wt config show` to view file-based configuration.
- **default-branch**: The repository's default branch (main, master, etc.)
- **previous-branch**: Previous branch for `wt switch -`
-- **ci-status**: CI/PR status for a branch (passed, running, failed, conflicts, noci)
+- **ci-status**: CI/PR status for a branch (passed, running, failed, conflicts, no-ci, error)
- **marker**: Custom status marker for a branch (shown in `wt list`)
- **logs**: Background operation logs
@@ -765,7 +767,8 @@ Caches GitHub/GitLab CI status for display in [wt list](@/list.md#ci-status).
| `running` | Checks in progress |
| `failed` | Checks failed |
| `conflicts` | PR has merge conflicts |
-| `noci` | No checks configured |
+| `no-ci` | No checks configured |
+| `error` | Fetch error (rate limit, network, auth) |
See [wt list CI status](@/list.md#ci-status) for display symbols and colors.
diff --git a/docs/content/faq.md b/docs/content/faq.md
index da33b706d..735a1f9d0 100644
--- a/docs/content/faq.md
+++ b/docs/content/faq.md
@@ -14,7 +14,7 @@ Worktrunk executes commands in three contexts:
2. **LLM commands** (`~/.config/worktrunk/config.toml`) — Commit message generation
3. **--execute flag** — Commands you provide explicitly
-Commands from project hooks and LLM configuration require approval on first run. Approved commands are saved to user config. If a command changes, Worktrunk requires new approval.
+Commands from project hooks require approval on first run. Approved commands are saved to user config. If a command changes, Worktrunk requires new approval.
### Example approval prompt
diff --git a/docs/content/hook.md b/docs/content/hook.md
index eaa2f6f26..225d12cfa 100644
--- a/docs/content/hook.md
+++ b/docs/content/hook.md
@@ -86,7 +86,7 @@ build = "cargo build --release"
### post-merge
-Runs after successful merge in the **main worktree**, **best-effort**. Failures are logged but don't abort.
+Runs after successful merge in the **worktree for the target branch** if it exists, otherwise the **main worktree**, **best-effort**. Failures are logged but don't abort.
**Use cases**: Deployment, notifications, installing updated binaries.
@@ -402,12 +402,11 @@ Usage: <b><span class=c>wt hook</span></b> <span class=c>[OPTIONS]</span> <span
### How Approvals Work
-Commands from project hooks (`.config/wt.toml`) and LLM configuration require
-approval on first run. This prevents untrusted projects from running arbitrary
-commands.
+Commands from project hooks (`.config/wt.toml`) require approval on first run.
+This prevents untrusted projects from running arbitrary commands.
**Approval flow:**
-1. Command is shown with expanded template variables
+1. Command is shown as a template (variables not expanded)
2. User approves or denies
3. Approved commands are saved to user config under `[projects."project-id"]`
diff --git a/docs/content/list.md b/docs/content/list.md
index c993eba9e..8ec55b901 100644
--- a/docs/content/list.md
+++ b/docs/content/list.md
@@ -8,7 +8,7 @@ group = "Commands"
<!-- ⚠️ AUTO-GENERATED from `wt list --help-page` — edit cli.rs to update -->
-Show all worktrees with their status. The table includes uncommitted changes, divergence from main and remote, and optional CI status.
+Show all worktrees with their status. The table includes uncommitted changes, divergence from the default branch and remote, and optional CI status.
The table renders progressively: branch names, paths, and commit hashes appear immediately, then status, divergence, and other columns fill in as background git operations complete. With `--full`, CI status fetches from the network — the table displays instantly and CI fills in as results arrive.
@@ -77,8 +77,8 @@ $ wt list --format=json
| Branch | Branch name |
| Status | Compact symbols (see below) |
| HEAD± | Uncommitted changes: +added -deleted lines |
-| main↕ | Commits ahead/behind main |
-| main…± | Line diffs in commits ahead of main (`--full`) |
+| main↕ | Commits ahead/behind default branch |
+| main…± | Line diffs since the merge-base with the default branch (`--full`) |
| Path | Worktree directory |
| Remote⇅ | Commits ahead/behind tracking branch |
| CI | Pipeline status (`--full`) |
@@ -86,6 +86,8 @@ $ wt list --format=json
| Age | Time since last commit |
| Message | Last commit message (truncated) |
+Note: `main↕` and `main…±` refer to the default branch (header label stays `main` for compactness). `main…±` uses a merge-base (three-dot) diff.
+
### CI status
The CI column shows GitHub/GitLab pipeline status:
@@ -118,14 +120,14 @@ The Status column has multiple subcolumns. Within each, only the first matching
| | `⚑` | Worktree path doesn't match branch name |
| | `⊟` | Prunable (directory missing) |
| | `⊞` | Locked worktree |
-| Main | `^` | Is the default branch |
-| | `✗` | Would conflict if merged to main |
-| | `_` | Same commit as main, clean |
-| | `–` | Same commit as main, uncommitted changes |
-| | `⊂` | Content [integrated](@/remove.md#branch-cleanup) into main or target |
-| | `↕` | Diverged from main |
-| | `↑` | Ahead of main |
-| | `↓` | Behind main |
+| Default branch | `^` | Is the default branch |
+| | `✗` | Would conflict if merged to the default branch |
+| | `_` | Same commit as the default branch, clean |
+| | `–` | Same commit as the default branch, uncommitted changes |
+| | `⊂` | Content [integrated](@/remove.md#branch-cleanup) into the default branch or target |
+| | `↕` | Diverged from the default branch |
+| | `↑` | Ahead of the default branch |
+| | `↓` | Behind the default branch |
| Remote | `\|` | In sync with remote |
| | `⇅` | Diverged from remote |
| | `⇡` | Ahead of remote |
@@ -147,7 +149,7 @@ wt list --format=json | jq '.[] | select(.working_tree.modified)'
# Current worktree
wt list --format=json | jq '.[] | select(.is_current)'
-# Branches ahead of main
+# Branches ahead of the default branch
wt list --format=json | jq '.[] | select(.main.ahead > 0)'
# Integrated branches (ready to clean up)
@@ -163,10 +165,10 @@ wt list --format=json | jq '.[] | select(.main_state == "integrated" or .main_st
| `kind` | string | `"worktree"` or `"branch"` |
| `commit` | object | Commit info (see below) |
| `working_tree` | object | Working tree state (see below) |
-| `main_state` | string | Relation to main (see below) |
+| `main_state` | string | Relation to the default branch (see below) |
| `integration_reason` | string | Why branch is integrated (see below) |
| `operation_state` | string | `"conflicts"`, `"rebase"`, or `"merge"` (absent when clean) |
-| `main` | object | Relationship to main branch (see below, absent when is_main) |
+| `main` | object | Relationship to the default branch (see below, absent when is_main) |
| `remote` | object | Tracking branch info (see below, absent when no tracking) |
| `worktree` | object | Worktree metadata (see below) |
| `is_main` | boolean | Is the main worktree |
@@ -195,15 +197,15 @@ wt list --format=json | jq '.[] | select(.main_state == "integrated" or .main_st
| `renamed` | boolean | Has renamed files |
| `deleted` | boolean | Has deleted files |
| `diff` | object | Lines changed vs HEAD: `{added, deleted}` |
-| `diff_vs_main` | object | Lines changed vs main: `{added, deleted}` |
+| `diff_vs_main` | object | Lines changed vs the default branch: `{added, deleted}` |
### main object
| Field | Type | Description |
|-------|------|-------------|
-| `ahead` | number | Commits ahead of main |
-| `behind` | number | Commits behind main |
-| `diff` | object | Lines changed vs main: `{added, deleted}` |
+| `ahead` | number | Commits ahead of the default branch |
+| `behind` | number | Commits behind the default branch |
+| `diff` | object | Lines changed vs the default branch: `{added, deleted}` |
### remote object
@@ -233,6 +235,8 @@ wt list --format=json | jq '.[] | select(.main_state == "integrated" or .main_st
### main_state values
+These values describe relation to the default branch.
+
`"is_main"` `"would_conflict"` `"empty"` `"same_commit"` `"integrated"` `"diverged"` `"ahead"` `"behind"`
### integration_reason values
@@ -271,7 +275,7 @@ Usage: <b><span class=c>wt list</span></b> <span class=c>[OPTIONS]</span>
Include remote branches
<b><span class=c>--full</span></b>
- Show CI and <b>main</b> diffstat
+ Show CI and default-branch merge-base diffstat (<b>main…±</b> column)
<b><span class=c>--progressive</span></b>
Show fast info immediately, update with slow info
diff --git a/docs/content/llm-commits.md b/docs/content/llm-commits.md
index af0be50da..ba44cda56 100644
--- a/docs/content/llm-commits.md
+++ b/docs/content/llm-commits.md
@@ -67,7 +67,7 @@ These examples assume a feature worktree with changes to commit.
### wt merge
-Squashes all changes (uncommitted + existing commits) into one commit with an LLM-generated message, then merges to main:
+Squashes all changes (uncommitted + existing commits) into one commit with an LLM-generated message, then merges to the default branch:
```bash
$ wt merge
diff --git a/docs/content/merge.md b/docs/content/merge.md
index cdde28c6c..ab8599928 100644
--- a/docs/content/merge.md
+++ b/docs/content/merge.md
@@ -17,7 +17,7 @@ group = "Commands"
## Examples
-Basic merge to main:
+Basic merge to the default branch:
```bash
wt merge
@@ -41,7 +41,7 @@ Preserve commit history (no squash):
wt merge --no-squash
```
-Skip git operations, only run hooks and push:
+Skip committing/squashing (rebase still runs unless --no-rebase):
```bash
wt merge --no-commit
@@ -59,7 +59,7 @@ wt merge --no-commit
6. **Cleanup** — Removes the worktree and branch. Use `--no-remove` to keep the worktree. When already on the target branch or in the main worktree, the worktree is preserved.
7. **Post-merge hooks** — Project commands run after cleanup. Failures are logged but don't abort.
-Use `--no-commit` to skip all git operations (steps 1-2) and only run hooks and merge. Useful after preparing commits manually with `wt step`. Requires a clean working tree.
+Use `--no-commit` to skip committing uncommitted changes and squashing; rebase still runs by default and can rewrite commits unless you pass `--no-rebase`. Useful after preparing commits manually with `wt step`. Requires a clean working tree.
## Local CI
@@ -67,7 +67,7 @@ For personal projects, pre-merge hooks open up the possibility of a workflow wit
Historically, ensuring tests ran before merging was difficult to enforce locally. Remote CI was valuable for the process as much as the checks: it guaranteed validation happened. `wt merge` brings that guarantee local.
-The full workflow: start an agent (one of many) on a task, work elsewhere, return when it's ready. Review the diff, run `wt merge`, move on. Pre-merge hooks validate before merging — if they pass, the branch goes to main and the worktree cleans up.
+The full workflow: start an agent (one of many) on a task, work elsewhere, return when it's ready. Review the diff, run `wt merge`, move on. Pre-merge hooks validate before merging — if they pass, the branch goes to the default branch and the worktree cleans up.
```toml
[pre-merge]
diff --git a/docs/content/remove.md b/docs/content/remove.md
index b002041a9..40df49ef1 100644
--- a/docs/content/remove.md
+++ b/docs/content/remove.md
@@ -43,13 +43,13 @@ Branches delete automatically when merging them would add nothing. This works wi
Worktrunk checks five conditions (in order of cost):
-1. **Same commit** — Branch HEAD equals main. Shows `_` in `wt list`.
+1. **Same commit** — Branch HEAD equals the default branch. Shows `_` in `wt list`.
2. **Ancestor** — Branch is in target's history (fast-forward or rebase case). Shows `⊂`.
3. **No added changes** — Three-dot diff (`target...branch`) is empty. Shows `⊂`.
4. **Trees match** — Branch tree SHA equals target tree SHA. Shows `⊂`.
5. **Merge adds nothing** — Simulated merge produces the same tree as target. Handles squash-merged branches where target has advanced. Shows `⊂`.
-Check 1 compares against main. Checks 2-5 compare against **target** — main, or origin/main when it's strictly ahead (catching branches merged remotely before pulling).
+Check 1 compares against the default branch. Checks 2-5 compare against **target** — the default branch, or its upstream (for example, `origin/main`) when it's strictly ahead (catching branches merged remotely before pulling).
Branches showing `_` or `⊂` are dimmed as safe to delete.
@@ -61,7 +61,7 @@ Removal runs in the background by default (returns immediately). Logs are writte
## Shortcuts
-`@` (current), `-` (previous), `^` (main worktree). See [wt switch](@/switch.md#shortcuts).
+`@` (current), `-` (previous), `^` (default branch). See [wt switch](@/switch.md#shortcuts).
## See also
diff --git a/docs/content/select.md b/docs/content/select.md
index 4f4a3f6d6..c34a6f0e4 100644
--- a/docs/content/select.md
+++ b/docs/content/select.md
@@ -30,8 +30,8 @@ wt select
Toggle between views with number keys:
1. **HEAD±** — Diff of uncommitted changes
-2. **log** — Recent commits; commits already on main have dimmed hashes
-3. **main…±** — Diff of all changes vs main branch
+2. **log** — Recent commits; commits already on the default branch have dimmed hashes
+3. **main…±** — Diff of changes since the merge-base with the default branch
## Keybindings
diff --git a/docs/content/step.md b/docs/content/step.md
index 0d21035c7..e9bcdc8aa 100644
--- a/docs/content/step.md
+++ b/docs/content/step.md
@@ -33,7 +33,7 @@ wt step push
- `commit` — Stage and commit with [LLM-generated message](@/llm-commits.md)
- `squash` — Squash all branch commits into one with [LLM-generated message](@/llm-commits.md)
- `rebase` — Rebase onto target branch
-- `push` — Push to target branch (default: main)
+- `push` — Push to target branch (defaults to the default branch)
- `for-each` — [experimental] Run a command in every worktree
## See also
diff --git a/docs/content/switch.md b/docs/content/switch.md
index 4c5e3b3da..5e470066b 100644
--- a/docs/content/switch.md
+++ b/docs/content/switch.md
@@ -51,7 +51,7 @@ wt switch --create temp --no-verify # Skip hooks
```bash
wt switch - # Back to previous
-wt switch ^ # Main worktree
+wt switch ^ # Default branch worktree
wt switch --create fix --base=@ # Branch from current HEAD
```
@@ -60,7 +60,7 @@ wt switch --create fix --base=@ # Branch from current HEAD
- [wt select](@/select.md) — Interactive worktree selection
- [wt list](@/list.md) — View all worktrees
- [wt remove](@/remove.md) — Delete worktrees when done
-- [wt merge](@/merge.md) — Integrate changes back to main
+- [wt merge](@/merge.md) — Integrate changes back to the default branch
## Command reference
@@ -73,7 +73,7 @@ Usage: <b><span class=c>wt switch</span></b> <span class=c>[OPTIONS]</span> <spa
<span class=c>&lt;BRANCH&gt;</span>
Branch or worktree name
- Shortcuts: &#39;^&#39; (main), &#39;-&#39; (previous), &#39;@&#39; (current)
+ Shortcuts: &#39;^&#39; (default branch), &#39;-&#39; (previous), &#39;@&#39; (current)
<span class=c>[EXECUTE_ARGS]...</span>
Additional arguments for --execute command (after --)
diff --git a/docs/content/tips-patterns.md b/docs/content/tips-patterns.md
index 2c38af5b4..deadef533 100644
--- a/docs/content/tips-patterns.md
+++ b/docs/content/tips-patterns.md
@@ -56,8 +56,8 @@ Custom emoji markers show agent state in `wt list`. The Claude Code plugin sets
Set status manually for any workflow:
```bash
-wt config var set marker "🚧" # Current branch
-wt config var set marker "✅" --branch feature # Specific branch
+wt config state marker set "🚧" # Current branch
+wt config state marker set "✅" --branch feature # Specific branch
git config worktrunk.state.feature.marker '{"marker":"💬","set_at":0}' # Direct
```
@@ -103,7 +103,7 @@ wt remove @ # Remove current worktree
## Stacked branches
-Branch from current HEAD instead of main:
+Branch from current HEAD instead of the default branch:
```bash
wt switch --create feature-part2 --base=@
diff --git a/docs/demos/wt-select/CLAUDE.md b/docs/demos/wt-select/CLAUDE.md
index bdf7b8cae..6cc390f9e 100644
--- a/docs/demos/wt-select/CLAUDE.md
+++ b/docs/demos/wt-select/CLAUDE.md
@@ -13,6 +13,25 @@ Creates:
Theme colors are defined in `docs/demos/shared/themes.py` to match the doc site's CSS variables.
+## Demo Goals
+
+The demo showcases `wt select` with **realistic variety in all columns**:
+
+```
+Branch Status HEAD± main↕ main…± Remote⇅ CI Age
+@ main ^ ○ now
++ streaming + +54 -5 ● now
++ doctor ↕ ↑1 ↓1 +320 -14 ● 2d
++ llm-templates ! ↕ +8 ↑1 ↓1 +263 -192 3d
+```
+
+Key demonstration points:
+- **CI column**: hollow ○ (branch CI) vs filled ● (PR CI) vs none
+- **HEAD± column**: Large staged diff (+54), small unstaged (+8), none
+- **Status column**: Staged changes (+), unstaged (!), ahead/behind (↕)
+- **main↕ column**: Some branches ahead-only, some ahead-and-behind
+- **main…± column**: Meaningful merge-base diffstats (small to 300+ lines)
+
## How It Works
Uses the **unified demo infrastructure** (`prepare_demo_repo()` from `shared/lib.py`), same as wt-core and wt-merge demos. The repo is a synthetic "acme" Rust project with alpha/beta/hooks branches designed to showcase column variety.
diff --git a/src/cli.rs b/src/cli.rs
index 154fa283f..c30740659 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -135,7 +135,7 @@ Getting started
wt switch --create feature Create worktree and branch
wt switch feature Switch to existing worktree
- wt merge Squash, rebase, and merge to main
+ wt merge Squash, rebase, and merge to the default branch
Run `wt config shell` to set up directory switching.
@@ -382,7 +382,7 @@ Use `wt config show` to view file-based configuration.
- **default-branch**: The repository's default branch (main, master, etc.)
- **previous-branch**: Previous branch for `wt switch -`
-- **ci-status**: CI/PR status for a branch (passed, running, failed, conflicts, noci)
+- **ci-status**: CI/PR status for a branch (passed, running, failed, conflicts, no-ci, error)
- **marker**: Custom status marker for a branch (shown in `wt list`)
- **logs**: Background operation logs
@@ -514,7 +514,8 @@ Without a subcommand, runs `get`."#
| `running` | Checks in progress |
| `failed` | Checks failed |
| `conflicts` | PR has merge conflicts |
-| `noci` | No checks configured |
+| `no-ci` | No checks configured |
+| `error` | Fetch error (rate limit, network, auth) |
See [wt list CI status](@/list.md#ci-status) for display symbols and colors.
@@ -1083,12 +1084,11 @@ pub enum HookCommand {
/// Manage command approvals
#[command(after_long_help = r#"## How Approvals Work
-Commands from project hooks (`.config/wt.toml`) and LLM configuration require
-approval on first run. This prevents untrusted projects from running arbitrary
-commands.
+Commands from project hooks (`.config/wt.toml`) require approval on first run.
+This prevents untrusted projects from running arbitrary commands.
**Approval flow:**
-1. Command is shown with expanded template variables
+1. Command is shown as a template (variables not expanded)
2. User approves or denies
3. Approved commands are saved to user config under `[projects."project-id"]`
@@ -1235,7 +1235,8 @@ stage = "all" # "all" (default), "tracked", or "none"
[merge]
# These flags are on by default; set to false to disable
squash = false # Preserve individual commits (--no-squash)
-commit = false # Skip committing uncommitted changes (--no-commit)
+commit = false # Skip committing uncommitted changes (also disables squash)
+rebase = false # Skip rebase (fails if not already rebased)
remove = false # Keep worktree after merge (--no-remove)
verify = false # Skip hooks (--no-verify)
```
@@ -1408,7 +1409,7 @@ wt step push
- `commit` — Stage and commit with [LLM-generated message](@/llm-commits.md)
- `squash` — Squash all branch commits into one with [LLM-generated message](@/llm-commits.md)
- `rebase` — Rebase onto target branch
-- `push` — Push to target branch (default: main)
+- `push` — Push to target branch (defaults to the default branch)
- `for-each` — [experimental] Run a command in every worktree
## See also
@@ -1505,7 +1506,7 @@ build = "cargo build --release"
### post-merge
-Runs after successful merge in the **main worktree**, **best-effort**. Failures are logged but don't abort.
+Runs after successful merge in the **worktree for the target branch** if it exists, otherwise the **main worktree**, **best-effort**. Failures are logged but don't abort.
**Use cases**: Deployment, notifications, installing updated binaries.
@@ -1815,8 +1816,8 @@ wt select
Toggle between views with number keys:
1. **HEAD±** — Diff of uncommitted changes
-2. **log** — Recent commits; commits already on main have dimmed hashes
-3. **main…±** — Diff of all changes vs main branch
+2. **log** — Recent commits; commits already on the default branch have dimmed hashes
+3. **main…±** — Diff of changes since the merge-base with the default branch
## Keybindings
@@ -1842,7 +1843,7 @@ Branches without worktrees are included — selecting one creates a worktree. (`
/// List worktrees and optionally branches
#[command(
- after_long_help = r#"Show all worktrees with their status. The table includes uncommitted changes, divergence from main and remote, and optional CI status.
+ after_long_help = r#"Show all worktrees with their status. The table includes uncommitted changes, divergence from the default branch and remote, and optional CI status.
The table renders progressively: branch names, paths, and commit hashes appear immediately, then status, divergence, and other columns fill in as background git operations complete. With `--full`, CI status fetches from the network — the table displays instantly and CI fills in as results arrive.
@@ -1882,8 +1883,8 @@ $ wt list --format=json
| Branch | Branch name |
| Status | Compact symbols (see below) |
| HEAD± | Uncommitted changes: +added -deleted lines |
-| main↕ | Commits ahead/behind main |
-| main…± | Line diffs in commits ahead of main (`--full`) |
+| main↕ | Commits ahead/behind default branch |
+| main…± | Line diffs since the merge-base with the default branch (`--full`) |
| Path | Worktree directory |
| Remote⇅ | Commits ahead/behind tracking branch |
| CI | Pipeline status (`--full`) |
@@ -1891,6 +1892,8 @@ $ wt list --format=json
| Age | Time since last commit |
| Message | Last commit message (truncated) |
+Note: `main↕` and `main…±` refer to the default branch (header label stays `main` for compactness). `main…±` uses a merge-base (three-dot) diff.
+
### CI status
The CI column shows GitHub/GitLab pipeline status:
@@ -1923,14 +1926,14 @@ The Status column has multiple subcolumns. Within each, only the first matching
| | `⚑` | Worktree path doesn't match branch name |
| | `⊟` | Prunable (directory missing) |
| | `⊞` | Locked worktree |
-| Main | `^` | Is the default branch |
-| | `✗` | Would conflict if merged to main |
-| | `_` | Same commit as main, clean |
-| | `–` | Same commit as main, uncommitted changes |
-| | `⊂` | Content [integrated](@/remove.md#branch-cleanup) into main or target |
-| | `↕` | Diverged from main |
-| | `↑` | Ahead of main |
-| | `↓` | Behind main |
+| Default branch | `^` | Is the default branch |
+| | `✗` | Would conflict if merged to the default branch |
+| | `_` | Same commit as the default branch, clean |
+| | `–` | Same commit as the default branch, uncommitted changes |
+| | `⊂` | Content [integrated](@/remove.md#branch-cleanup) into the default branch or target |
+| | `↕` | Diverged from the default branch |
+| | `↑` | Ahead of the default branch |
+| | `↓` | Behind the default branch |
| Remote | `\|` | In sync with remote |
| | `⇅` | Diverged from remote |
| | `⇡` | Ahead of remote |
@@ -1952,7 +1955,7 @@ wt list --format=json | jq '.[] | select(.working_tree.modified)'
# Current worktree
wt list --format=json | jq '.[] | select(.is_current)'
-# Branches ahead of main
+# Branches ahead of the default branch
wt list --format=json | jq '.[] | select(.main.ahead > 0)'
# Integrated branches (ready to clean up)
@@ -1968,10 +1971,10 @@ wt list --format=json | jq '.[] | select(.main_state == "integrated" or .main_st
| `kind` | string | `"worktree"` or `"branch"` |
| `commit` | object | Commit info (see below) |
| `working_tree` | object | Working tree state (see below) |
-| `main_state` | string | Relation to main (see below) |
+| `main_state` | string | Relation to the default branch (see below) |
| `integration_reason` | string | Why branch is integrated (see below) |
| `operation_state` | string | `"conflicts"`, `"rebase"`, or `"merge"` (absent when clean) |
-| `main` | object | Relationship to main branch (see below, absent when is_main) |
+| `main` | object | Relationship to the default branch (see below, absent when is_main) |
| `remote` | object | Tracking branch info (see below, absent when no tracking) |
| `worktree` | object | Worktree metadata (see below) |
| `is_main` | boolean | Is the main worktree |
@@ -2000,15 +2003,15 @@ wt list --format=json | jq '.[] | select(.main_state == "integrated" or .main_st
| `renamed` | boolean | Has renamed files |
| `deleted` | boolean | Has deleted files |
| `diff` | object | Lines changed vs HEAD: `{added, deleted}` |
-| `diff_vs_main` | object | Lines changed vs main: `{added, deleted}` |
+| `diff_vs_main` | object | Lines changed vs the default branch: `{added, deleted}` |
### main object
| Field | Type | Description |
|-------|------|-------------|
-| `ahead` | number | Commits ahead of main |
-| `behind` | number | Commits behind main |
-| `diff` | object | Lines changed vs main: `{added, deleted}` |
+| `ahead` | number | Commits ahead of the default branch |
+| `behind` | number | Commits behind the default branch |
+| `diff` | object | Lines changed vs the default branch: `{added, deleted}` |
### remote object
@@ -2038,6 +2041,8 @@ wt list --format=json | jq '.[] | select(.main_state == "integrated" or .main_st
### main_state values
+These values describe relation to the default branch.
+
`"is_main"` `"would_conflict"` `"empty"` `"same_commit"` `"integrated"` `"diverged"` `"ahead"` `"behind"`
### integration_reason values
@@ -2074,7 +2079,7 @@ When `main_state == "integrated"`: `"ancestor"` `"trees_match"` `"no_added_chang
#[arg(long)]
remotes: bool,
- /// Show CI and `main` diffstat
+ /// Show CI and default-branch merge-base diffstat (`main…±` column)
#[arg(long)]
full: bool,
@@ -2135,7 +2140,7 @@ wt switch --create temp --no-verify # Skip hooks
```console
wt switch - # Back to previous
-wt switch ^ # Main worktree
+wt switch ^ # Default branch worktree
wt switch --create fix --base=@ # Branch from current HEAD
```
@@ -2144,13 +2149,13 @@ wt switch --create fix --base=@ # Branch from current HEAD
- [wt select](@/select.md) — Interactive worktree selection
- [wt list](@/list.md) — View all worktrees
- [wt remove](@/remove.md) — Delete worktrees when done
-- [wt merge](@/merge.md) — Integrate changes back to main
+- [wt merge](@/merge.md) — Integrate changes back to the default branch
"#
)]
Switch {
/// Branch or worktree name
///
- /// Shortcuts: '^' (main), '-' (previous), '@' (current)
+ /// Shortcuts: '^' (default branch), '-' (previous), '@' (current)
#[arg(add = crate::completion::worktree_branch_completer())]
branch: String,
@@ -2240,13 +2245,13 @@ Branches delete automatically when merging them would add nothing. This works wi
Worktrunk checks five conditions (in order of cost):
-1. **Same commit** — Branch HEAD equals main. Shows `_` in `wt list`.
+1. **Same commit** — Branch HEAD equals the default branch. Shows `_` in `wt list`.
2. **Ancestor** — Branch is in target's history (fast-forward or rebase case). Shows `⊂`.
3. **No added changes** — Three-dot diff (`target...branch`) is empty. Shows `⊂`.
4. **Trees match** — Branch tree SHA equals target tree SHA. Shows `⊂`.
5. **Merge adds nothing** — Simulated merge produces the same tree as target. Handles squash-merged branches where target has advanced. Shows `⊂`.
-Check 1 compares against main. Checks 2-5 compare against **target** — main, or origin/main when it's strictly ahead (catching branches merged remotely before pulling).
+Check 1 compares against the default branch. Checks 2-5 compare against **target** — the default branch, or its upstream (for example, `origin/main`) when it's strictly ahead (catching branches merged remotely before pulling).
Branches showing `_` or `⊂` are dimmed as safe to delete.
@@ -2258,7 +2263,7 @@ Removal runs in the background by default (returns immediately). Logs are writte
## Shortcuts
-`@` (current), `-` (previous), `^` (main worktree). See [wt switch](@/switch.md#shortcuts).
+`@` (current), `-` (previous), `^` (default branch). See [wt switch](@/switch.md#shortcuts).
## See also
@@ -2299,7 +2304,7 @@ Removal runs in the background by default (returns immediately). Logs are writte
## Examples
-Basic merge to main:
+Basic merge to the default branch:
```console
wt merge
@@ -2323,7 +2328,7 @@ Preserve commit history (no squash):
wt merge --no-squash
```
-Skip git operations, only run hooks and push:
+Skip committing/squashing (rebase still runs unless --no-rebase):
```console
wt merge --no-commit
@@ -2341,7 +2346,7 @@ wt merge --no-commit
6. **Cleanup** — Removes the worktree and branch. Use `--no-remove` to keep the worktree. When already on the target branch or in the main worktree, the worktree is preserved.
7. **Post-merge hooks** — Project commands run after cleanup. Failures are logged but don't abort.
-Use `--no-commit` to skip all git operations (steps 1-2) and only run hooks and merge. Useful after preparing commits manually with `wt step`. Requires a clean working tree.
+Use `--no-commit` to skip committing uncommitted changes and squashing; rebase still runs by default and can rewrite commits unless you pass `--no-rebase`. Useful after preparing commits manually with `wt step`. Requires a clean working tree.
## Local CI
@@ -2349,7 +2354,7 @@ For personal projects, pre-merge hooks open up the possibility of a workflow wit
Historically, ensuring tests ran before merging was difficult to enforce locally. Remote CI was valuable for the process as much as the checks: it guaranteed validation happened. `wt merge` brings that guarantee local.
-The full workflow: start an agent (one of many) on a task, work elsewhere, return when it's ready. Review the diff, run `wt merge`, move on. Pre-merge hooks validate before merging — if they pass, the branch goes to main and the worktree cleans up.
+The full workflow: start an agent (one of many) on a task, work elsewhere, return when it's ready. Review the diff, run `wt merge`, move on. Pre-merge hooks validate before merging — if they pass, the branch goes to the default branch and the worktree cleans up.
```toml
[pre-merge]
diff --git a/src/commands/select.rs b/src/commands/select.rs
index 35d18357d..cd753a6da 100644
--- a/src/commands/select.rs
+++ b/src/commands/select.rs
@@ -179,8 +179,8 @@ fn run_git_diff_with_pager(git_args: &[&str], pager_cmd: &str) -> Option<String>
///
/// Each mode shows a different aspect of the worktree:
/// 1. WorkingTree: Uncommitted changes (git diff HEAD --stat)
-/// 2. Log: Commit history since diverging from main (git log with merge-base)
-/// 3. BranchDiff: Line diffs in commits ahead of main (git diff --stat main…)
+/// 2. Log: Commit history since diverging from the default branch (git log with merge-base)
+/// 3. BranchDiff: Line diffs since the merge-base with the default branch (git diff --stat DEFAULT…)
///
/// Loosely aligned with `wt list` columns, though not a perfect match:
/// - Tab 1 corresponds to "HEAD±" column
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_create.snap b/tests/snapshots/integration__integration_tests__help__help_config_create.snap
index 551e83011..3dd4b3039 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_create.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_create.snap
@@ -9,7 +9,7 @@ info:
env:
CLICOLOR_FORCE: "1"
COLUMNS: "150"
- GIT_EDITOR: ""
+ GIT_CONFIG_GLOBAL: ""
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
@@ -93,7 +93,7 @@ Creates ~/.config/worktrunk/config.toml with the following content:
# List Command Defaults
# Configure default behavior for `wt list`
[list]
- full = false # Show CI and `main` diffstat by default
+ full = false # Show CI and default-branch merge-base diffstat (`main…±` column) by default
branches = false # Include branches without worktrees by default
remotes = false # Include remote branches by default

@@ -105,13 +105,14 @@ Creates ~/.config/worktrunk/config.toml with the following content:
# Note: `stage` defaults from [commit] section above
[merge]
squash = true # Squash commits when merging
- commit = true # Commit, squash, and rebase during merge
+ commit = true # Commit uncommitted changes during merge (disables squash when false)
+ rebase = true # Rebase onto target before merging
remove = true # Remove worktree after merge
verify = true # Run project hooks

# Approved Commands
- # Commands approved for automatic execution after switching worktrees
- # Auto-populated when you use: wt switch --execute "command" --force
+ # Commands approved for project hooks in this repo
+ # Auto-populated when you approve hooks (prompt on first run) or run: wt hook approvals add
[projects."github.com/user/repo"]
approved-commands = ["npm install"]

@@ -251,7 +252,7 @@ With --project, creates .config/wt.toml in the current repositor
# {{ repo_root }} - Absolute path to the repository root
#
# Merge-related hooks also support:
- # {{ target }} - Target branch for the merge (e.g., "main")
+ # {{ target }} - Target branch for the merge (e.g., "main" default branch)
#
# Filters:
# {{ branch | sanitize }} - Replace / and \ with - (e.g., "feature-foo")
@@ -315,7 +316,7 @@ With --project, creates .config/wt.toml in the current repositor
# build = "cargo build --release"

# Post-Merge Hook
- # Runs SEQUENTIALLY in the main worktree after successful merge (blocking)
+ # Runs SEQUENTIALLY in the worktree for the target branch if it exists, otherwise the main worktree (blocking)
# Runs after push and cleanup complete
# Use for: updating production builds, notifications, cleanup
#
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_long.snap b/tests/snapshots/integration__integration_tests__help__help_config_long.snap
index bfdfaf80c..0e903c9b5 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_long.snap
@@ -8,7 +8,7 @@ info:
env:
CLICOLOR_FORCE: "1"
COLUMNS: "150"
- GIT_EDITOR: ""
+ GIT_CONFIG_GLOBAL: ""
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
@@ -118,7 +118,8 @@ Set persistent flag values for commands. These apply unless explicitly overridde
[merge]
# These flags are on by default; set to false to disable
squash = false # Preserve individual commits (--no-squash)
- commit = false # Skip committing uncommitted changes (--no-commit)
+ commit = false # Skip committing uncommitted changes (also disables squash)
+ rebase = false # Skip rebase (fails if not already rebased)
remove = false # Keep worktree after merge (--no-remove)
verify = false # Skip hooks (--no-verify)
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state.snap b/tests/snapshots/integration__integration_tests__help__help_config_state.snap
index b0480dc40..020b4f397 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_state.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_state.snap
@@ -9,7 +9,8 @@ info:
env:
CLICOLOR_FORCE: "1"
COLUMNS: "150"
- GIT_EDITOR: ""
+ GIT_CONFIG_GLOBAL: ""
+ RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
---
@@ -52,7 +53,7 @@ Use wt config show to view file-based configuration.
- default-branch: The repository's default branch (main, master, etc.)
- previous-branch: Previous branch for wt switch -
-- ci-status: CI/PR status for a branch (passed, running, failed, conflicts, noci)
+- ci-status: CI/PR status for a branch (passed, running, failed, conflicts, no-ci, error)
- marker: Custom status marker for a branch (shown in wt list)
- logs: Background operation logs
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_ci_status.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_ci_status.snap
index d2a48738c..67d20f300 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_ci_status.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_state_ci_status.snap
@@ -10,7 +10,8 @@ info:
env:
CLICOLOR_FORCE: "1"
COLUMNS: "150"
- GIT_EDITOR: ""
+ GIT_CONFIG_GLOBAL: ""
+ RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
---
@@ -52,13 +53,14 @@ Caches GitHub/GitLab CI status for display in wt list.
Status values
- Status Meaning
- ───────── ──────────────────────
- passed All checks passed
- running Checks in progress
- failed Checks failed
- conflicts PR has merge conflicts
- noci No checks configured
+ Status Meaning
+ ───────── ───────────────────────────────────────
+ passed All checks passed
+ running Checks in progress
+ failed Checks failed
+ conflicts PR has merge conflicts
+ no-ci No checks configured
+ error Fetch error (rate limit, network, auth)
See wt list CI status for display symbols and colors.
diff --git a/tests/snapshots/integration__integration_tests__help__help_hook_approvals.snap b/tests/snapshots/integration__integration_tests__help__help_hook_approvals.snap
index 8aa33482d..2297cf44c 100644
--- a/tests/snapshots/integration__integration_tests__help__help_hook_approvals.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_hook_approvals.snap
@@ -9,7 +9,8 @@ info:
env:
CLICOLOR_FORCE: "1"
COLUMNS: "150"
- GIT_EDITOR: ""
+ GIT_CONFIG_GLOBAL: ""
+ RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
---
@@ -42,12 +43,11 @@ Usage: wt hook approvals [OPTIONS] <COMMAND>
How Approvals Work
-Commands from project hooks (.config/wt.toml) and LLM configuration require
-approval on first run. This prevents untrusted projects from running arbitrary
-commands.
+Commands from project hooks (.config/wt.toml) require approval on first run.
+This prevents untrusted projects from running arbitrary commands.
Approval flow:
-1. Command is shown with expanded template variables
+1. Command is shown as a template (variables not expanded)
2. User approves or denies
3. Approved commands are saved to user config under [projects."project-id"]
diff --git a/tests/snapshots/integration__integration_tests__help__help_list_long.snap b/tests/snapshots/integration__integration_tests__help__help_list_long.snap
index c65ab11d7..2defbe467 100644
--- a/tests/snapshots/integration__integration_tests__help__help_list_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_list_long.snap
@@ -8,7 +8,8 @@ info:
env:
CLICOLOR_FORCE: "1"
COLUMNS: "150"
- GIT_EDITOR: ""
+ GIT_CONFIG_GLOBAL: ""
+ RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
---
@@ -38,7 +39,7 @@ Usage: wt list [OPTIONS]
Include remote branches
--full
- Show CI and main diffstat
+ Show CI and default-branch merge-base diffstat (main…± column)
--progressive
Show fast info immediately, update with slow info
@@ -58,7 +59,7 @@ Usage: wt list [OPTIONS]
-v, --verbose
Show commands and debug info
-Show all worktrees with their status. The table includes uncommitted changes, divergence from main and remote, and optional CI status.
+Show all worktrees with their status. The table includes uncommitted changes, divergence from the default branch and remote, and optional CI status.
The table renders progressively: branch names, paths, and commit hashes appear immediately, then status, divergence, and other columns fill in as
background git operations complete. With --full, CI status fetches from the network — the table displays instantly and CI fills in as results
@@ -84,19 +85,21 @@ Output as JSON for scripting:
Columns
- Column Shows
- ─────── ────────────────────────────────────────────
- Branch Branch name
- Status Compact symbols (see below)
- HEAD± Uncommitted changes: +added -deleted lines
- main↕ Commits ahead/behind main
- main…± Line diffs in commits ahead of main (--full)
- Path Worktree directory
- Remote⇅ Commits ahead/behind tracking branch
- CI Pipeline status (--full)
- Commit Short hash (8 chars)
- Age Time since last commit
- Message Last commit message (truncated)
+ Column Shows
+ ─────── ────────────────────────────────────────────────────────────────
+ Branch Branch name
+ Status Compact symbols (see below)
+ HEAD± Uncommitted changes: +added -deleted lines
+ main↕ Commits ahead/behind default branch
+ main…± Line diffs since the merge-base with the default branch (--full)
+ Path Worktree directory
+ Remote⇅ Commits ahead/behind tracking branch
+ CI Pipeline status (--full)
+ Commit Short hash (8 chars)
+ Age Time since last commit
+ Message Last commit message (truncated)
+
+Note: main↕ and main…± refer to the default branch (header label stays main for compactness). main…± uses a merge-base (three-dot) diff.
CI status
@@ -120,30 +123,30 @@ seconds; use wt config state to view or clear.
The Status column has multiple subcolumns. Within each, only the first matching symbol is shown (listed in priority order):
- Subcolumn Symbol Meaning
- ──────────────── ────── ────────────────────────────────────────
- Working tree (1) + Staged files
- Working tree (2) ! Modified files (unstaged)
- Working tree (3) ? Untracked files
- Worktree ✘ Merge conflicts
- ⤴ Rebase in progress
- ⤵ Merge in progress
- / Branch without worktree
- ⚑ Worktree path doesn't match branch name
- ⊟ Prunable (directory missing)
- ⊞ Locked worktree
- Main ^ Is the default branch
- ✗ Would conflict if merged to main
- _ Same commit as main, clean
- – Same commit as main, uncommitted changes
- ⊂ Content integrated into main or target
- ↕ Diverged from main
- ↑ Ahead of main
- ↓ Behind main
- Remote \| In sync with remote
- ⇅ Diverged from remote
- ⇡ Ahead of remote
- ⇣ Behind remote
+ Subcolumn Symbol Meaning
+ ──────────────── ────── ──────────────────────────────────────────────────────
+ Working tree (1) + Staged files
+ Working tree (2) ! Modified files (unstaged)
+ Working tree (3) ? Untracked files
+ Worktree ✘ Merge conflicts
+ ⤴ Rebase in progress
+ ⤵ Merge in progress
+ / Branch without worktree
+ ⚑ Worktree path doesn't match branch name
+ ⊟ Prunable (directory missing)
+ ⊞ Locked worktree
+ Default branch ^ Is the default branch
+ ✗ Would conflict if merged to the default branch
+ _ Same commit as the default branch, clean
+ – Same commit as the default branch, uncommitted changes
+ ⊂ Content integrated into the default branch or target
+ ↕ Diverged from the default branch
+ ↑ Ahead of the default branch
+ ↓ Behind the default branch
+ Remote \| In sync with remote
+ ⇅ Diverged from remote
+ ⇡ Ahead of remote
+ ⇣ Behind remote
Rows are dimmed when safe to delete (_ same commit with clean working tree or ⊂ content integrated).
@@ -160,7 +163,7 @@ Query structured data with --format=json:
# Current worktree
wt list --format=json | jq '.[] | select(.is_current)'

- # Branches ahead of main
+ # Branches ahead of the default branch
wt list --format=json | jq '.[] | select(.main.ahead > 0)'

# Integrated branches (ready to clean up)
@@ -168,25 +171,25 @@ Query structured data with --format=json:
Fields:
- Field Type Description
- ────────────────── ─────────── ────────────────────────────────────────────────────────────
- branch string/null Branch name (null for detached HEAD)
- path string Worktree path (absent for branches without worktrees)
- kind string "worktree" or "branch"
- commit object Commit info (see below)
- working_tree object Working tree state (see below)
- main_state string Relation to main (see below)
- integration_reason string Why branch is integrated (see below)
- operation_state string "conflicts", "rebase", or "merge" (absent when clean)
- main object Relationship to main branch (see below, absent when is_main)
- remote object Tracking branch info (see below, absent when no tracking)
- worktree object Worktree metadata (see below)
- is_main boolean Is the main worktree
- is_current boolean Is the current worktree
- is_previous boolean Previous worktree from wt switch
- ci object CI status (see below, absent when no CI)
- statusline string Pre-formatted status with ANSI colors
- symbols string Raw status symbols without colors (e.g., "!?↓")
+ Field Type Description
+ ────────────────── ─────────── ───────────────────────────────────────────────────────────────────
+ branch string/null Branch name (null for detached HEAD)
+ path string Worktree path (absent for branches without worktrees)
+ kind string "worktree" or "branch"
+ commit object Commit info (see below)
+ working_tree object Working tree state (see below)
+ main_state string Relation to the default branch (see below)
+ integration_reason string Why branch is integrated (see below)
+ operation_state string "conflicts", "rebase", or "merge" (absent when clean)
+ main object Relationship to the default branch (see below, absent when is_main)
+ remote object Tracking branch info (see below, absent when no tracking)
+ worktree object Worktree metadata (see below)
+ is_main boolean Is the main worktree
+ is_current boolean Is the current worktree
+ is_previous boolean Previous worktree from wt switch
+ ci object CI status (see below, absent when no CI)
+ statusline string Pre-formatted status with ANSI colors
+ symbols string Raw status symbols without colors (e.g., "!?↓")
commit object
@@ -199,23 +202,23 @@ Query structured data with --format=json:
working_tree object
- Field Type Description
- ──────────── ─────── ───────────────────────────────────────
- staged boolean Has staged files
- modified boolean Has modified files (unstaged)
- untracked boolean Has untracked files
- renamed boolean Has renamed files
- deleted boolean Has deleted files
- diff object Lines changed vs HEAD: {added, deleted}
- diff_vs_main object Lines changed vs main: {added, deleted}
+ Field Type Description
+ ──────────── ─────── ─────────────────────────────────────────────────────
+ staged boolean Has staged files
+ modified boolean Has modified files (unstaged)
+ untracked boolean Has untracked files
+ renamed boolean Has renamed files
+ deleted boolean Has deleted files
+ diff object Lines changed vs HEAD: {added, deleted}
+ diff_vs_main object Lines changed vs the default branch: {added, deleted}
main object
- Field Type Description
- ────── ────── ───────────────────────────────────────
- ahead number Commits ahead of main
- behind number Commits behind main
- diff object Lines changed vs main: {added, deleted}
+ Field Type Description
+ ────── ────── ─────────────────────────────────────────────────────
+ ahead number Commits ahead of the default branch
+ behind number Commits behind the default branch
+ diff object Lines changed vs the default branch: {added, deleted}
remote object
@@ -245,6 +248,8 @@ Query structured data with --format=json:
main_state values
+These values describe relation to the default branch.
+
"is_main" "would_conflict" "empty" "same_commit" "integrated" "diverged" "ahead" "behind"
integration_reason values
diff --git a/tests/snapshots/integration__integration_tests__help__help_list_narrow_80.snap b/tests/snapshots/integration__integration_tests__help__help_list_narrow_80.snap
index b6d393876..f5759ecbd 100644
--- a/tests/snapshots/integration__integration_tests__help__help_list_narrow_80.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_list_narrow_80.snap
@@ -8,7 +8,8 @@ info:
env:
CLICOLOR_FORCE: "1"
COLUMNS: "80"
- GIT_EDITOR: ""
+ GIT_CONFIG_GLOBAL: ""
+ RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
---
@@ -38,7 +39,7 @@ Usage: wt list [OPTIONS]
Include remote branches
--full
- Show CI and main diffstat
+ Show CI and default-branch merge-base diffstat (main…± column)
--progressive
Show fast info immediately, update with slow info
@@ -60,7 +61,7 @@ Usage: wt list [OPTIONS]
Show commands and debug info
Show all worktrees with their status. The table includes uncommitted changes,
-divergence from main and remote, and optional CI status.
+divergence from the default branch and remote, and optional CI status.
The table renders progressively: branch names, paths, and commit hashes appear
immediately, then status, divergence, and other columns fill in as background
@@ -87,19 +88,22 @@ Output as JSON for scripting:
Columns
- Column Shows
- ─────── ────────────────────────────────────────────
- Branch Branch name
- Status Compact symbols (see below)
- HEAD± Uncommitted changes: +added -deleted lines
- main↕ Commits ahead/behind main
- main…± Line diffs in commits ahead of main (--full)
- Path Worktree directory
- Remote⇅ Commits ahead/behind tracking branch
- CI Pipeline status (--full)
- Commit Short hash (8 chars)
- Age Time since last commit
- Message Last commit message (truncated)
+ Column Shows
+ ─────── ────────────────────────────────────────────────────────────────
+ Branch Branch name
+ Status Compact symbols (see below)
+ HEAD± Uncommitted changes: +added -deleted lines
+ main↕ Commits ahead/behind default branch
+ main…± Line diffs since the merge-base with the default branch (--full)
+ Path Worktree directory
+ Remote⇅ Commits ahead/behind tracking branch
+ CI Pipeline status (--full)
+ Commit Short hash (8 chars)
+ Age Time since last commit
+ Message Last commit message (truncated)
+
+Note: main↕ and main…± refer to the default branch (header label stays
+main for compactness). main…± uses a merge-base (three-dot) diff.
CI status
@@ -126,30 +130,32 @@ to view or clear.
The Status column has multiple subcolumns. Within each, only the first matching
symbol is shown (listed in priority order):
- Subcolumn Symbol Meaning
- ──────────────── ────── ────────────────────────────────────────
- Working tree (1) + Staged files
- Working tree (2) ! Modified files (unstaged)
- Working tree (3) ? Untracked files
- Worktree ✘ Merge conflicts
- ⤴ Rebase in progress
- ⤵ Merge in progress
- / Branch without worktree
- ⚑ Worktree path doesn't match branch name
- ⊟ Prunable (directory missing)
- ⊞ Locked worktree
- Main ^ Is the default branch
- ✗ Would conflict if merged to main
- _ Same commit as main, clean
- – Same commit as main, uncommitted changes
- ⊂ Content integrated into main or target
- ↕ Diverged from main
- ↑ Ahead of main
- ↓ Behind main
- Remote \| In sync with remote
- ⇅ Diverged from remote
- ⇡ Ahead of remote
- ⇣ Behind remote
+ Subcolumn Symbol Meaning
+ ──────────────── ────── ────────────────────────────────────────────────────
+ Working tree (1) + Staged files
+ Working tree (2) ! Modified files (unstaged)
+ Working tree (3) ? Untracked files
+ Worktree ✘ Merge conflicts
+ ⤴ Rebase in progress
+ ⤵ Merge in progress
+ / Branch without worktree
+ ⚑ Worktree path doesn't match branch name
+ ⊟ Prunable (directory missing)
+ ⊞ Locked worktree
+ Default branch ^ Is the default branch
+ ✗ Would conflict if merged to the default branch
+ _ Same commit as the default branch, clean
+ – Same commit as the default branch, uncommitted
+ changes
+| | ⊂ | Content integrated into the default
+branch or target |
+ ↕ Diverged from the default branch
+ ↑ Ahead of the default branch
+ ↓ Behind the default branch
+ Remote \| In sync with remote
+ ⇅ Diverged from remote
+ ⇡ Ahead of remote
+ ⇣ Behind remote
Rows are dimmed when safe to delete (_ same
commit with clean working tree or ⊂ content integrated).
@@ -167,7 +173,7 @@ Query structured data with --format=json:
# Current worktree
wt list --format=json | jq '.[] | select(.is_current)'

- # Branches ahead of main
+ # Branches ahead of the default branch
wt list --format=json | jq '.[] | select(.main.ahead > 0)'

# Integrated branches (ready to clean up)
@@ -184,12 +190,12 @@ Query structured data with --format=json:
kind string "worktree" or "branch"
commit object Commit info (see below)
working_tree object Working tree state (see below)
- main_state string Relation to main (see below)
+ main_state string Relation to the default branch (see below)
integration_reason string Why branch is integrated (see below)
| operation_state | string | "conflicts", "rebase", or "merge" (absent
when clean) |
-| main | object | Relationship to main branch (see below, absent when is_main)
-
+| main | object | Relationship to the default branch (see below, absent when
+is_main) |
| remote | object | Tracking branch info (see below, absent when no tracking)
─────────── ─────── ───────────────────────────────────────────────
worktree object Worktree metadata (see below)
@@ -211,23 +217,24 @@ when clean) |
working_tree object
- Field Type Description
- ──────────── ─────── ───────────────────────────────────────
- staged boolean Has staged files
- modified boolean Has modified files (unstaged)
- untracked boolean Has untracked files
- renamed boolean Has renamed files
- deleted boolean Has deleted files
- diff object Lines changed vs HEAD: {added, deleted}
- diff_vs_main object Lines changed vs main: {added, deleted}
+ Field Type Description
+ ───────── ─────── ───────────────────────────────────────
+ staged boolean Has staged files
+ modified boolean Has modified files (unstaged)
+ untracked boolean Has untracked files
+ renamed boolean Has renamed files
+ deleted boolean Has deleted files
+ diff object Lines changed vs HEAD: {added, deleted}
+| diff_vs_main | object | Lines changed vs the default branch: {added,
+deleted} |
main object
- Field Type Description
- ────── ────── ───────────────────────────────────────
- ahead number Commits ahead of main
- behind number Commits behind main
- diff object Lines changed vs main: {added, deleted}
+ Field Type Description
+ ────── ────── ─────────────────────────────────────────────────────
+ ahead number Commits ahead of the default branch
+ behind number Commits behind the default branch
+ diff object Lines changed vs the default branch: {added, deleted}
remote object
@@ -258,6 +265,8 @@ normal) |
main_state values
+These values describe relation to the default branch.
+
"is_main" "would_conflict" "empty" "same_commit" "integrated"
"diverged" "ahead" "behind"
diff --git a/tests/snapshots/integration__integration_tests__help__help_list_short.snap b/tests/snapshots/integration__integration_tests__help__help_list_short.snap
index 6b542041e..0b5309d17 100644
--- a/tests/snapshots/integration__integration_tests__help__help_list_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_list_short.snap
@@ -8,7 +8,8 @@ info:
env:
CLICOLOR_FORCE: "1"
COLUMNS: "150"
- GIT_EDITOR: ""
+ GIT_CONFIG_GLOBAL: ""
+ RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
---
@@ -29,7 +30,7 @@ Usage: wt list [OPTIONS]
--format <FORMAT> Output format (table, json) [default: table]
--branches Include branches without worktrees
--remotes Include remote branches
- --full Show CI and main diffstat
+ --full Show CI and default-branch merge-base diffstat (main…± column)
--progressive Show fast info immediately, update with slow info
-h, --help Print help (see more with '--help')
diff --git a/tests/snapshots/integration__integration_tests__help__help_md_merge.snap b/tests/snapshots/integration__integration_tests__help__help_md_merge.snap
index a31827a2d..33bd89a31 100644
--- a/tests/snapshots/integration__integration_tests__help__help_md_merge.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_md_merge.snap
@@ -8,7 +8,7 @@ info:
env:
CLICOLOR_FORCE: "1"
COLUMNS: "150"
- GIT_EDITOR: ""
+ GIT_CONFIG_GLOBAL: ""
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
@@ -72,7 +72,7 @@ Global Options:
## Examples
-Basic merge to main:
+Basic merge to the default branch:
```bash
wt merge
@@ -96,7 +96,7 @@ Preserve commit history (no squash):
wt merge --no-squash
```
-Skip git operations, only run hooks and push:
+Skip committing/squashing (rebase still runs unless --no-rebase):
```bash
wt merge --no-commit
@@ -117,8 +117,8 @@ changes become a separate commit and individual commits are preserved.
the worktree is preserved.
7. **Post-merge hooks** — Project commands run after cleanup. Failures are logged but don't abort.
-Use `--no-commit` to skip all git operations (steps 1-2) and only run hooks and merge. Useful after preparing commits manually with `wt step`.
-Requires a clean working tree.
+Use `--no-commit` to skip committing uncommitted changes and squashing; rebase still runs by default and can rewrite commits unless you pass
+`--no-rebase`. Useful after preparing commits manually with `wt step`. Requires a clean working tree.
## Local CI
@@ -129,7 +129,7 @@ Historically, ensuring tests ran before merging was difficult to enforce locally
guaranteed validation happened. `wt merge` brings that guarantee local.
The full workflow: start an agent (one of many) on a task, work elsewhere, return when it's ready. Review the diff, run `wt merge`, move on. Pre-merge
-hooks validate before merging — if they pass, the branch goes to main and the worktree cleans up.
+hooks validate before merging — if they pass, the branch goes to the default branch and the worktree cleans up.
```toml
[pre-merge]
diff --git a/tests/snapshots/integration__integration_tests__help__help_md_root.snap b/tests/snapshots/integration__integration_tests__help__help_md_root.snap
index 40a395d4a..f260c1a90 100644
--- a/tests/snapshots/integration__integration_tests__help__help_md_root.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_md_root.snap
@@ -7,7 +7,8 @@ info:
env:
CLICOLOR_FORCE: "1"
COLUMNS: "150"
- GIT_EDITOR: ""
+ GIT_CONFIG_GLOBAL: ""
+ RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
---
@@ -49,7 +50,7 @@ Getting started
wt switch --create feature Create worktree and branch
wt switch feature Switch to existing worktree
- wt merge Squash, rebase, and merge to main
+ wt merge Squash, rebase, and merge to the default branch
Run `wt config shell` to set up directory switching.
diff --git a/tests/snapshots/integration__integration_tests__help__help_merge_long.snap b/tests/snapshots/integration__integration_tests__help__help_merge_long.snap
index 1864194c9..5179d0e8b 100644
--- a/tests/snapshots/integration__integration_tests__help__help_merge_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_merge_long.snap
@@ -8,7 +8,7 @@ info:
env:
CLICOLOR_FORCE: "1"
COLUMNS: "150"
- GIT_EDITOR: ""
+ GIT_CONFIG_GLOBAL: ""
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
@@ -73,7 +73,7 @@ Usage: wt merge [OPTIONS] [TARGET]
Examples
-Basic merge to main:
+Basic merge to the default branch:
wt merge
@@ -89,7 +89,7 @@ Preserve commit history (no squash):
wt merge --no-squash
-Skip git operations, only run hooks and push:
+Skip committing/squashing (rebase still runs unless --no-rebase):
wt merge --no-commit
@@ -108,8 +108,8 @@ changes become a separate commit and individual commits are preserved.
the worktree is preserved.
7. Post-merge hooks — Project commands run after cleanup. Failures are logged but don't abort.
-Use --no-commit to skip all git operations (steps 1-2) and only run hooks and merge. Useful after preparing commits manually with wt step.
-Requires a clean working tree.
+Use --no-commit to skip committing uncommitted changes and squashing; rebase still runs by default and can rewrite commits unless you pass
+--no-rebase. Useful after preparing commits manually with wt step. Requires a clean working tree.
Local CI
@@ -120,7 +120,7 @@ Historically, ensuring tests ran before merging was difficult to enforce locally
guaranteed validation happened. wt merge brings that guarantee local.
The full workflow: start an agent (one of many) on a task, work elsewhere, return when it's ready. Review the diff, run wt merge, move on. Pre-merge
-hooks validate before merging — if they pass, the branch goes to main and the worktree cleans up.
+hooks validate before merging — if they pass, the branch goes to the default branch and the worktree cleans up.
[pre-merge]
test = "cargo test"
diff --git a/tests/snapshots/integration__integration_tests__help__help_page_merge.snap b/tests/snapshots/integration__integration_tests__help__help_page_merge.snap
index 3161e992b..98ebbda72 100644
--- a/tests/snapshots/integration__integration_tests__help__help_page_merge.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_page_merge.snap
@@ -8,7 +8,7 @@ info:
env:
CLICOLOR_FORCE: "1"
COLUMNS: "150"
- GIT_EDITOR: ""
+ GIT_CONFIG_GLOBAL: ""
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
@@ -27,7 +27,7 @@ exit_code: 0
## Examples
-Basic merge to main:
+Basic merge to the default branch:
```bash
wt merge
@@ -51,7 +51,7 @@ Preserve commit history (no squash):
wt merge --no-squash
```
-Skip git operations, only run hooks and push:
+Skip committing/squashing (rebase still runs unless --no-rebase):
```bash
wt merge --no-commit
@@ -69,7 +69,7 @@ wt merge --no-commit
6. **Cleanup** — Removes the worktree and branch. Use `--no-remove` to keep the worktree. When already on the target branch or in the main worktree, the worktree is preserved.
7. **Post-merge hooks** — Project commands run after cleanup. Failures are logged but don't abort.
-Use `--no-commit` to skip all git operations (steps 1-2) and only run hooks and merge. Useful after preparing commits manually with `wt step`. Requires a clean working tree.
+Use `--no-commit` to skip committing uncommitted changes and squashing; rebase still runs by default and can rewrite commits unless you pass `--no-rebase`. Useful after preparing commits manually with `wt step`. Requires a clean working tree.
## Local CI
@@ -77,7 +77,7 @@ For personal projects, pre-merge hooks open up the possibility of a workflow wit
Historically, ensuring tests ran before merging was difficult to enforce locally. Remote CI was valuable for the process as much as the checks: it guaranteed validation happened. `wt merge` brings that guarantee local.
-The full workflow: start an agent (one of many) on a task, work elsewhere, return when it's ready. Review the diff, run `wt merge`, move on. Pre-merge hooks validate before merging — if they pass, the branch goes to main and the worktree cleans up.
+The full workflow: start an agent (one of many) on a task, work elsewhere, return when it's ready. Review the diff, run `wt merge`, move on. Pre-merge hooks validate before merging — if they pass, the branch goes to the default branch and the worktree cleans up.
```toml
[pre-merge]
diff --git a/tests/snapshots/integration__integration_tests__help__help_page_switch.snap b/tests/snapshots/integration__integration_tests__help__help_page_switch.snap
index 3c3890c39..290a1e7a8 100644
--- a/tests/snapshots/integration__integration_tests__help__help_page_switch.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_page_switch.snap
@@ -8,7 +8,7 @@ info:
env:
CLICOLOR_FORCE: "1"
COLUMNS: "150"
- GIT_EDITOR: ""
+ GIT_CONFIG_GLOBAL: ""
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
@@ -61,7 +61,7 @@ wt switch --create temp --no-verify # Skip hooks
```bash
wt switch - # Back to previous
-wt switch ^ # Main worktree
+wt switch ^ # Default branch worktree
wt switch --create fix --base=@ # Branch from current HEAD
```
@@ -70,7 +70,7 @@ wt switch --create fix --base=@ # Branch from current HEAD
- [wt select](@/select.md) — Interactive worktree selection
- [wt list](@/list.md) — View all worktrees
- [wt remove](@/remove.md) — Delete worktrees when done
-- [wt merge](@/merge.md) — Integrate changes back to main
+- [wt merge](@/merge.md) — Integrate changes back to the default branch
## Command reference
@@ -83,7 +83,7 @@ Usage: wt switch [OPTIONS] <BRANCH> [--
<BRANCH>
Branch or worktree name

- Shortcuts: '^' (main), '-' (previous), '@' (current)
+ Shortcuts: '^' (default branch), '-' (previous), '@' (current)
[EXECUTE_ARGS]...
Additional arguments for --execute command (after --)
diff --git a/tests/snapshots/integration__integration_tests__help__help_remove_long.snap b/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
index bd76f305b..3c91742d1 100644
--- a/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
@@ -8,7 +8,7 @@ info:
env:
CLICOLOR_FORCE: "1"
COLUMNS: "150"
- GIT_EDITOR: ""
+ GIT_CONFIG_GLOBAL: ""
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
@@ -83,14 +83,14 @@ file changes match.
Worktrunk checks five conditions (in order of cost):
-1. Same commit — Branch HEAD equals main. Shows _ in wt list.
+1. Same commit — Branch HEAD equals the default branch. Shows _ in wt list.
2. Ancestor — Branch is in target's history (fast-forward or rebase case). Shows ⊂.
3. No added changes — Three-dot diff (target...branch) is empty. Shows ⊂.
4. Trees match — Branch tree SHA equals target tree SHA. Shows ⊂.
5. Merge adds nothing — Simulated merge produces the same tree as target. Handles squash-merged branches where target has advanced. Shows ⊂.
-Check 1 compares against main. Checks 2-5 compare against target — main, or origin/main when it's strictly ahead (catching branches merged
-remotely before pulling).
+Check 1 compares against the default branch. Checks 2-5 compare against target — the default branch, or its upstream (for example, origin/main)
+when it's strictly ahead (catching branches merged remotely before pulling).
Branches showing _ or ⊂ are dimmed as safe to delete.
@@ -103,7 +103,7 @@ in the foreground.
Shortcuts
-@ (current), - (previous), ^ (main worktree). See wt switch.
+@ (current), - (previous), ^ (default branch). See wt switch.
See also
diff --git a/tests/snapshots/integration__integration_tests__help__help_root_long.snap b/tests/snapshots/integration__integration_tests__help__help_root_long.snap
index 6c5ad2e25..ab41b585b 100644
--- a/tests/snapshots/integration__integration_tests__help__help_root_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_root_long.snap
@@ -7,7 +7,8 @@ info:
env:
CLICOLOR_FORCE: "1"
COLUMNS: "150"
- GIT_EDITOR: ""
+ GIT_CONFIG_GLOBAL: ""
+ RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
---
@@ -51,7 +52,7 @@ Getting started
wt switch --create feature Create worktree and branch
wt switch feature Switch to existing worktree
- wt merge Squash, rebase, and merge to main
+ wt merge Squash, rebase, and merge to the default branch
Run wt config shell to set up directory switching.
diff --git a/tests/snapshots/integration__integration_tests__help__help_step_long.snap b/tests/snapshots/integration__integration_tests__help__help_step_long.snap
index 9b09c1645..231a6bb81 100644
--- a/tests/snapshots/integration__integration_tests__help__help_step_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_step_long.snap
@@ -8,7 +8,8 @@ info:
env:
CLICOLOR_FORCE: "1"
COLUMNS: "150"
- GIT_EDITOR: ""
+ GIT_CONFIG_GLOBAL: ""
+ RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
---
@@ -63,7 +64,7 @@ Manual merge workflow with review between steps:
- commit — Stage and commit with LLM-generated message
- squash — Squash all branch commits into one with LLM-generated message
- rebase — Rebase onto target branch
-- push — Push to target branch (default: main)
+- push — Push to target branch (defaults to the default branch)
- for-each — [experimental] Run a command in every worktree
See also
diff --git a/tests/snapshots/integration__integration_tests__help__help_switch_long.snap b/tests/snapshots/integration__integration_tests__help__help_switch_long.snap
index 1476ad5f8..673e2b98d 100644
--- a/tests/snapshots/integration__integration_tests__help__help_switch_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_switch_long.snap
@@ -8,7 +8,7 @@ info:
env:
CLICOLOR_FORCE: "1"
COLUMNS: "150"
- GIT_EDITOR: ""
+ GIT_CONFIG_GLOBAL: ""
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
@@ -26,7 +26,7 @@ Usage: wt switch [OPTIONS] <BRANCH> [--
<BRANCH>
Branch or worktree name
- Shortcuts: '^' (main), '-' (previous), '@' (current)
+ Shortcuts: '^' (default branch), '-' (previous), '@' (current)
[EXECUTE_ARGS]...
Additional arguments for --execute command (after --)
@@ -116,7 +116,7 @@ When creating a worktree, worktrunk:
- Previous worktree (like cd -)
wt switch - # Back to previous
- wt switch ^ # Main worktree
+ wt switch ^ # Default branch worktree
wt switch --create fix --base=@ # Branch from current HEAD
See also
@@ -124,4 +124,4 @@ When creating a worktree, worktrunk:
- wt select — Interactive worktree selection
- wt list — View all worktrees
- wt remove — Delete worktrees when done
-- wt merge — Integrate changes back to main
+- wt merge — Integrate changes back to the default branch