Merge Modes¶
wt supports different strategies for merging completed work back to the main branch. Choose the mode that fits your workflow.
Available Modes¶
Direct¶
Push directly to the default branch without a PR.
Best for:
- Solo projects
- Prototypes and experiments
- Trusted environments
Workflow:
PR Auto-Merge¶
Create a PR and auto-merge when CI passes.
Best for:
- Solo projects with CI/CD
- Trusted automation
- Fast iteration
Workflow:
wt done
# → Commits changes
# → Pushes branch
# → Creates PR
# → Enables auto-merge
# → Bead marked as awaiting_review
# (PR auto-merges when CI passes)
# → Bead auto-closed on merge
PR Review (Default)¶
Create a PR and wait for human review.
Best for:
- Team projects
- Code requiring review
- Production systems
Workflow:
wt done
# → Commits changes
# → Pushes branch
# → Creates PR
# → Bead marked as awaiting_review
# Human reviews and merges PR
# → Bead auto-closed on merge
Configuration¶
Global Default¶
Set the default merge mode for all projects:
Per-Project¶
Override for specific projects:
Per-Session Override¶
Override when completing work:
Configuration Options¶
| Option | Description | Default |
|---|---|---|
merge_mode |
direct, pr-auto, or pr-review |
pr-review |
require_ci |
Wait for CI to pass before merge | true |
auto_merge_on_green |
Auto-merge PRs when CI passes | false |
default_branch |
Branch to merge into | main |
PR Templates¶
PRs created by wt include:
- Title from bead title
- Description from bead description
- Link back to bead
- Automatic labels (if configured)
Example PR:
## Summary
Add user authentication flow
Closes: myproject-abc123
## Changes
- Added login/logout endpoints
- Implemented JWT token handling
- Added auth middleware
## Testing
- Unit tests added
- Manual testing completed
CI Integration¶
GitHub Actions¶
wt works with GitHub's auto-merge feature. Enable in your repo:
- Settings → General → Allow auto-merge
- Set up branch protection rules
- Configure
pr-automerge mode
Branch Protection¶
Recommended settings for pr-auto:
- Require pull request reviews: Off (or 0 reviewers)
- Require status checks to pass: On
- Require branches to be up to date: On
For pr-review:
- Require pull request reviews: On (1+ reviewers)
- Require status checks to pass: On
Bead Status Transitions¶
| Action | direct | pr-auto | pr-review |
|---|---|---|---|
wt done |
closed | awaiting_review | awaiting_review |
| CI passes | - | auto-merge triggers | - |
| PR merged | - | closed | closed |
| Manual close | closed | closed | closed |