merge / rebase / squash / verify
gwt merge
Full merge pipeline: verify, rebase, squash, merge, and cleanup.
gwt merge [target] [--keep]
Options
| Option | Description |
|---|---|
target | Branch to merge into (default: auto-detect upstream) |
--keep | Keep worktree and branch after merge |
Pipeline steps
- Verify — runs
pre-mergehooks - Rebase — rebases current branch onto target
- Squash — combines all commits into one (see below)
- Merge — fast-forward merges into target
- Post-merge hooks — runs
post-mergehooks (non-blocking) - Cleanup — removes worktree and branch (unless
--keep)
If you’re already on the target branch, the command errors out — switch to a feature branch first.
gwt verify
Run pre-merge hooks to check if the branch is ready to merge.
gwt verify
This is a shortcut for dispatching the pre-merge hook event. Configure what runs in [hooks.pre-merge].
gwt rebase
Rebase the current branch onto a target.
gwt rebase [target]
Options
| Option | Description |
|---|---|
target | Branch to rebase onto (default: auto-detect upstream) |
gwt squash
Squash all commits on the current branch into one.
gwt squash [target]
Options
| Option | Description |
|---|---|
target | Branch for merge-base calculation (default: auto-detect) |
AI commit messages
If merge.commit-message-command is configured, gwt passes the squash diff to the configured command and presents the generated message:
Generated commit message:
feat: add user authentication with OAuth2 support
Use this message? [Y/n/edit]
- Y (default) — use the generated message
- n — enter a message manually
- edit — open the message in
$EDITOR
If the command fails, falls back to manual input.
Configuration
[merge]
commit-message-command = "your-ai-tool summarize-commits"