wt step

Run individual git workflow operations: commits, squashes, rebases, and pushes.

Examples

Commit with LLM-generated message:

wt step commit

Manual merge workflow with review between steps:

wt step commit
wt step squash
# Review the squashed commit
wt step rebase
wt step push

Operations

See also

Command reference

wt step - Run individual workflow operations

Usage: wt step [OPTIONS] <COMMAND>

Commands:
  commit    Commit changes with LLM commit message
  squash    Squash commits down to target
  push      Push changes to local target branch
  rebase    Rebase onto target
  for-each  [experimental] Run command in each worktree

Options:
  -h, --help
          Print help (see a summary with '-h')

Global Options:
  -C <path>
          Working directory for this command

      --config <path>
          User config file path

  -v, --verbose
          Show commands and debug info

wt step for-each

Executes a command sequentially in every worktree with real-time output. Continues on failure and shows a summary at the end.

Context JSON is piped to stdin for scripts that need structured data.

Template variables

All variables are shell-escaped:

VariableDescription
{{ branch }}Branch name (raw, e.g., feature/foo)
{{ branch | sanitize }}Branch name with / and \ replaced by -
{{ worktree }}Absolute path to the worktree
{{ worktree_name }}Worktree directory name
{{ repo }}Repository name
{{ repo_root }}Absolute path to the main repository root
{{ commit }}Current HEAD commit SHA (full)
{{ short_commit }}Current HEAD commit SHA (7 chars)
{{ default_branch }}Default branch name (e.g., "main")
{{ remote }}Primary remote name (e.g., "origin")
{{ remote_url }}Primary remote URL
{{ upstream }}Upstream tracking branch, if configured

Examples

Check status across all worktrees:

wt step for-each -- git status --short

Run npm install in all worktrees:

wt step for-each -- npm install

Use branch name in command:

wt step for-each -- "echo Branch: {{ branch }}"

Pull updates in worktrees with upstreams (skips others):

git fetch --prune && wt step for-each -- '[ "$(git rev-parse @{u} 2>/dev/null)" ] || exit 0; git pull --autostash'

Note: This command is experimental and may change in future versions.

Command reference

wt step for-each - [experimental] Run command in each worktree

Usage: wt step for-each [OPTIONS] -- <ARGS>...

Arguments:
  <ARGS>...
          Command template (see --help for all variables)

Options:
  -h, --help
          Print help (see a summary with '-h')

Global Options:
  -C <path>
          Working directory for this command

      --config <path>
          User config file path

  -v, --verbose
          Show commands and debug info