Command Reference¶
Complete reference for all stackit commands.
Auto-generated content
This page includes auto-generated command documentation from stackit --help.
stackit <command> [flags]
stackit is a command-line tool that makes working with stacked changes fast and intuitive.
abort¶
stackit abort [flags]
Aborts the current stackit command halted by a conflict. This command cancels any in-progress operation (such as restack, sync, merge, or absorb) that has been paused due to a conflict. Any changes made during the operation will be rolled back.
Flags:
| Flag | Description |
|---|---|
-f, --force |
Do not prompt for confirmation; abort immediately. |
-h, --help |
help for abort |
absorb¶
stackit absorb [flags]
Amend staged changes to the relevant commits in the current stack. Relevance is calculated by checking the changes in each commit downstack from the current commit, and finding the first commit that each staged hunk (consecutive lines of changes) can be applied to deterministically. If there is no clear commit to absorb a hunk into, it will not be absorbed. Prompts for confirmation before amending the commits, and restacks the branches upstack of the current branch. CONFLICT RESOLUTION: If absorb encounters a merge conflict, use 'stackit abort' to restore the original state. Use --show-conflict to see the current conflict state and what changes were being applied.
Flags:
| Flag | Description |
|---|---|
-a, --all |
Stage all unstaged changes before absorbing. Unlike create and modify, this will not include untracked files, as file creations would never be absorbed. |
-d, --dry-run |
Print which commits the hunks would be absorbed into, but do not actually absorb them. |
-f, --force |
Do not prompt for confirmation; apply the hunks to the commits immediately. |
-h, --help |
help for absorb |
--json |
Output machine-readable JSON summary (works with --dry-run for preview) |
-p, --patch |
Pick hunks to stage before absorbing. |
--show-conflict |
Show the current absorb conflict state |
agent¶
stackit agent [command]
Manage agent integration files that help AI assistants use stackit effectively. This command generates configuration files that enable AI agents (like Claude Code and Codex) to understand how to use stackit commands for managing stacked branches.
Flags:
| Flag | Description |
|---|---|
-h, --help |
help for agent |
bottom¶
stackit bottom [flags]
Switch to the branch closest to trunk in the current stack. This command navigates down the parent chain from the current branch until it reaches the first branch that has trunk as its parent (or trunk itself).
Flags:
| Flag | Description |
|---|---|
-h, --help |
help for bottom |
checkout¶
stackit checkout [branch] [flags]
Aliases:
checkout, co
Switch to a branch. If no branch is provided, opens an interactive selector. The interactive selector allows you to navigate branches using arrow keys and filter by typing. Use flags to customize which branches are shown.
Flags:
| Flag | Description |
|---|---|
-a, --all |
Show branches across all configured trunks in interactive selection |
-h, --help |
help for checkout |
-u, --show-untracked |
Include untracked branches in interactive selection |
-s, --stack |
Only show ancestors and descendants of the current branch in interactive selection |
-t, --trunk |
Checkout the current trunk |
children¶
stackit children [flags]
Show the children of the current branch. Lists all branches that have the current branch as their parent in the stack. This is useful for understanding the structure of your stack and seeing which branches depend on the current branch.
Flags:
| Flag | Description |
|---|---|
-h, --help |
help for children |
completion¶
stackit completion [command]
Generate the autocompletion script for stackit for the specified shell. See each sub-command's help for details on how to use the generated script.
Flags:
| Flag | Description |
|---|---|
-h, --help |
help for completion |
config¶
stackit config [flags]
stackit config [command]
Get and set repository configuration values. When run without subcommands, opens an interactive TUI for editing configuration. Use --list to print all configuration values instead. Examples: stackit config # Interactive TUI stackit config --list # Print all config values stackit config get branch.pattern stackit config set branch.pattern "{username}/{date}/{message}" stackit config get submit.footer stackit config set submit.footer false
Flags:
| Flag | Description |
|---|---|
-h, --help |
help for config |
-l, --list |
Print all configuration values instead of opening interactive TUI |
continue¶
stackit continue [flags]
Continues the most recent Stackit command halted by a rebase conflict. This command will continue the rebase and resume restacking remaining branches.
Flags:
| Flag | Description |
|---|---|
-a, --all |
Stage all changes before continuing |
-h, --help |
help for continue |
create¶
stackit create [name] [flags]
Create a new branch stacked on top of the current branch and commit staged changes. If no branch name is specified, generate a branch name from the commit message. If your working directory contains no changes, an empty branch will be created. If you have any unstaged changes, you will be asked whether you'd like to stage them.
Flags:
| Flag | Description |
|---|---|
-a, --all |
Stage all unstaged changes before creating the branch, including to untracked files |
-h, --help |
help for create |
-i, --insert |
Insert this branch between the current branch and its child. If there are multiple children, prompts you to select which should be moved onto the new branch |
-m, --message string |
Specify a commit message |
-p, --patch |
Pick hunks to stage before committing |
--scope string |
Set a scope (e.g., Jira ticket ID, Linear ID) for the new branch. If not provided, inherits from parent branch |
-u, --update |
Stage all updates to tracked files before creating the branch |
-v, --verbose count |
Show unified diff between the HEAD commit and what would be committed at the bottom of the commit message template. If specified twice, show in addition the unified diff between what would be committed and the worktree files |
-w, --worktree |
Create a dedicated worktree for this stack (only valid when creating a new stack from trunk) |
debug¶
stackit debug [flags]
Dump comprehensive debugging information including recent command history and complete stack state. This is useful for diagnosing issues when stacks get into a bad state. The output includes: - Recent commands and their parameters (from undo snapshots) - Complete stack state (branches, relationships, metadata, PR info) - Continuation state (if exists) - Repository information - Remote metadata state (with --remote flag) Output is formatted as pretty-printed JSON for easy reading and parsing.
Flags:
| Flag | Description |
|---|---|
-h, --help |
help for debug |
--limit int |
Limit the number of recent commands to show (0 = all) |
--remote |
Fetch and show remote metadata state |
delete¶
stackit delete [name] [flags]
Delete a branch and its stackit metadata (local-only). Children will be restacked onto the parent branch. If the branch is not merged or closed, prompts for confirmation. This command does not perform any action on GitHub or the remote repository. If you delete a branch with an open pull request, you will need to manually close the pull request.
Flags:
| Flag | Description |
|---|---|
--downstack |
Also delete any ancestors of the specified branch. |
-f, --force |
Delete the branch even if it is not merged or closed. |
-h, --help |
help for delete |
--upstack |
Also delete any children of the specified branch. |
describe¶
stackit describe [flags]
Set a title and description for the current stack. The description is stored on the stack's root branch (the first branch above trunk) and applies to the entire stack. It can help others understand what the stack is about. When run without flags, opens your configured editor (like git commit). Examples: stackit describe # Opens editor to set/edit description stackit describe -m "Auth Feature" # Set title only (short flag like git commit) stackit describe -m "Auth" -d "OAuth2 impl" # Set title and description stackit describe --show # Display current description stackit describe --clear # Remove description
Flags:
| Flag | Description |
|---|---|
--clear |
Remove the stack description |
-d, --description string |
Set the stack description body (requires -m) |
-h, --help |
help for describe |
--show |
Display the current stack description |
-m, --title string |
Set the stack title (non-interactive) |
doctor¶
stackit doctor [flags]
Run diagnostic checks on your stackit environment and repository. The doctor command checks: - Environment: Git version, GitHub CLI, and authentication - Repository: Git repository status, remote configuration, and trunk branch - Stack State: Metadata integrity, cycle detection, and missing parent branches
Flags:
| Flag | Description |
|---|---|
--fix |
Attempt to automatically fix any issues found |
-h, --help |
help for doctor |
down¶
stackit down [steps] [flags]
Switch to the parent of the current branch. Navigates down the stack toward trunk by switching to the parent branch. By default, moves one level down. Use the --steps flag or pass a number as an argument to move multiple levels at once.
Flags:
| Flag | Description |
|---|---|
-h, --help |
help for down |
-n, --steps int |
The number of levels to traverse downstack. (default 1) |
flatten¶
stackit flatten [branch] [flags]
Flatten the stack by re-parenting branches as close to trunk as possible. The command analyzes each branch in the stack and tests whether it can be rebased directly onto trunk (or an intermediate branch closer to trunk). Branches that depend on changes from their parent will stay in place. This is useful after landing PRs from the middle of a stack, or when you have independent changes that were developed as a chain but don't actually depend on each other. Examples: stackit flatten # Flatten stack from current branch stackit flatten feature # Flatten stack from the 'feature' branch stackit flatten --yes # Skip confirmation prompt
Flags:
| Flag | Description |
|---|---|
-h, --help |
help for flatten |
-y, --yes |
Skip confirmation prompt. |
fold¶
stackit fold [flags]
Fold a branch's changes into its parent, update dependencies of descendants of the new combined branch, and restack. This is useful when you have a branch that is no longer needed and you want to combine its changes with its parent branch. If the parent of the current branch is the trunk (e.g., main), you must provide the --allow-trunk flag, as this will modify your local trunk branch directly. This command does not perform any action on GitHub or the remote repository. If you fold a branch with an open pull request, you will need to manually close the pull request.
Flags:
| Flag | Description |
|---|---|
--allow-trunk |
Allows folding into the trunk branch (e.g., main). |
--dry-run |
Shows what would happen without applying any changes. |
-h, --help |
help for fold |
-k, --keep |
Keeps the name of the current branch instead of using the name of its parent. |
foreach¶
stackit foreach <command> [args...] [flags]
Executes a shell command on each branch in the current stack, bottom-up. The command is executed via /bin/sh -c. By default, it runs on the current branch and all its descendants (up-stack). Examples: st foreach mise run lint st foreach --stack 'go test ./... && go build' st foreach --downstack go test ./... st foreach --parallel mise run test
Flags:
| Flag | Description |
|---|---|
--downstack |
Run on current branch and ancestors |
-h, --help |
help for foreach |
-j, --jobs int |
Number of parallel jobs (default: number of CPUs) |
--no-fail-fast |
Don't stop execution on the first failure |
-p, --parallel |
Run commands in parallel using git worktrees |
--stack |
Run on the entire stack (ancestors and descendants) |
--upstack |
Run on current branch and descendants (default) (default true) |
freeze¶
stackit freeze [branch] [flags]
Freeze specified branch and branches downstack of it locally. Freezing a branch prevents local modifications (like modify, squash, absorb) and restacking. Unlike 'st lock', freezing is strictly local to your machine and is not shared with collaborators. Use 'st freeze' when you want to stack on top of someone else’s PRs without accidentally modifying them or affecting their metadata. Frozen branches are automatically updated from remote via 'st sync' or 'st get' using hard-resets. This operation can be undone with 'st unfreeze'.
Flags:
| Flag | Description |
|---|---|
-h, --help |
help for freeze |
get¶
stackit get [branch|PR] [flags]
Sync branches from trunk to the given branch from remote, prompting the user to resolve any conflicts. If the branch passed to get already exists locally, any local branches upstack of the branch are also synced; to opt out of this behavior, use the --downstack flag. Note that remote-only branches upstack of the branch are not currently synced. If no branch is provided, sync the current stack.
Flags:
| Flag | Description |
|---|---|
-d, --downstack |
When syncing a branch that already exists locally, don't sync upstack branches. |
-f, --force |
Overwrite all fetched branches with remote source of truth |
-h, --help |
help for get |
--no-restack |
Skip restacking branches |
--restack |
Restack any branches in the stack that can be restacked without conflicts (default true) |
-U, --unfrozen |
Checkout new branches as unfrozen (allow local edits) |
github¶
stackit github [command]
Manage GitHub integration for stackit, including CI checks.
Flags:
| Flag | Description |
|---|---|
-h, --help |
help for github |
help¶
stackit help [command] [flags]
Help provides help for any command in the application. Simply type stackit help [path to command] for full details.
Flags:
| Flag | Description |
|---|---|
-h, --help |
help for help |
info¶
stackit info [branch] [flags]
Aliases:
info, i
Display information about a branch, including branch relationships, PR status, and optionally diffs or patches. If --stack is provided, displays information about all branches in the current stack. If no branch is specified and --stack is not provided, displays information about the current branch.
Flags:
| Flag | Description |
|---|---|
-b, --body |
Show the PR body, if it exists |
-d, --diff |
Show the diff between this branch and its parent. Takes precedence over patch |
-h, --help |
help for info |
--json |
Output in JSON format |
-p, --patch |
Show the changes made by each commit |
--stack |
Show information about the entire stack |
-s, --stat |
Show a diffstat instead of a full diff. Modifies either --patch or --diff. If neither is passed, implies --diff |
init¶
stackit init [flags]
Aliases:
init, i
Initialize Stackit in the current repository
Flags:
| Flag | Description |
|---|---|
-h, --help |
help for init |
--no-interactive |
Disable interactive prompts |
--reset |
Untrack all branches |
--trunk string |
The name of your trunk branch |
lock¶
stackit lock [branch] [flags]
Lock specified branch and branches downstack of it. Locking a branch prevents local modifications and restacking for everyone collaborating on the stack. The locked status is stored in remote metadata and shared with others when they 'st get' or 'st sync' the stack. Use 'st lock' to signal to your team that certain branches are stable and should not be modified. For local-only protection (e.g. when building on top of a colleague's PR), use 'st freeze' instead. This operation can be undone with 'st unlock'.
Flags:
| Flag | Description |
|---|---|
-h, --help |
help for lock |
log¶
stackit log [flags]
stackit log [command]
Log all branches tracked by Stackit, showing dependencies and info for each
Flags:
| Flag | Description |
|---|---|
-h, --help |
help for log |
-i, --interactive |
Enable interactive mode with scrolling and collapsing |
--shas |
Show commit SHAs next to branch names (useful for debugging) |
-u, --show-untracked |
Include untracked branches in interactive selection |
-s, --stack |
Only show ancestors and descendants of the current branch |
-n, --steps int |
Only show this many levels upstack and downstack. Implies --stack |
main¶
stackit main [flags]
Aliases:
main, m
Switch to the main/trunk branch. Navigates to the configured trunk branch (typically "main" or "master").
Flags:
| Flag | Description |
|---|---|
-h, --help |
help for main |
merge¶
stackit merge [flags]
stackit merge [command]
Merge pull requests associated with your stack. When run without a subcommand, launches an interactive wizard to guide you through the merge process. Subcommands: status Show shippability status of your stacks next Merge the next (bottom-most) unmerged PR in the stack drain Merge all PRs bottom-up, waiting for each to complete ship Consolidate all branches into a single PR and merge atomically Use --scope or --branch to skip the initial prompts and go straight to strategy selection. Examples: stackit merge # Launch interactive merge wizard stackit merge --scope=PROJ-100 # Merge all branches in scope PROJ-100 stackit merge --branch=feature # Merge from specific branch stackit merge status # Show your mergeable work stackit merge status --all # Show entire team's mergeable work stackit merge next # Merge bottom PR, restack, stop stackit merge drain # Merge all PRs bottom-up, wait for each stackit merge ship # Consolidate all branches into single PR
Flags:
| Flag | Description |
|---|---|
--branch string |
Pre-select target branch to merge from (skips branch prompt) |
--dry-run |
Show merge plan without executing |
--force |
Skip validation checks (draft PRs, failing CI) |
-h, --help |
help for merge |
--scope string |
Pre-select scope to merge (skips scope prompt) |
--wait |
Wait for merge to complete (default: fire-and-forget) |
modify¶
stackit modify [flags]
Modify the current branch by amending its commit or creating a new commit. Automatically restacks descendants after the modification. Examples: stackit modify -a -m "Updated feature" # Stage all and amend with message stackit modify -a # Stage all and amend (opens editor) stackit modify -p # Interactive patch staging then amend stackit modify -c -a -m "New commit" # Create new commit instead of amending stackit modify --interactive-rebase # Interactive rebase on branch commits
Flags:
| Flag | Description |
|---|---|
-a, --all |
Stage all changes before committing. |
-c, --commit |
Create a new commit instead of amending the current commit. If this branch has no commits, this command always creates a new commit. |
-e, --edit |
If passed, open an editor to edit the commit message. |
-h, --help |
help for modify |
--interactive-rebase |
Ignore all other flags and start a git interactive rebase on the commits in this branch. |
-m, --message string |
The message for the new or amended commit. If passed, no editor is opened. |
-n, --no-edit |
Don't modify the existing commit message. Takes precedence over --edit. |
-p, --patch |
Pick hunks to stage before committing. |
--reset-author |
Set the author of the commit to the current user if amending. |
-u, --update |
Stage all updates to tracked files before committing. |
-v, --verbose count |
Show unified diff between the HEAD commit and what would be committed at the bottom of the commit message template. |
move¶
stackit move [flags]
Move a branch to a new parent, rebasing only its own commits onto the target. This command changes the branch's parent pointer and rebases the branch's commits onto the new parent. Only the branch's own commits are moved - commits from ancestor branches are NOT included. After moving, all descendant branches are automatically restacked. Examples: stackit move --onto main # Move current branch to be a child of main stackit move --source feature-b --onto feature-a # Move feature-b onto feature-a If no --onto is specified, opens an interactive selector to choose the target.
Flags:
| Flag | Description |
|---|---|
-a, --all |
Show branches across all configured trunks in interactive selection. |
--dry-run |
Show what would happen without making changes. |
-h, --help |
help for move |
-o, --onto string |
Branch to move the current branch onto. |
--rename |
Auto-rename branch when scope changes during move. |
--source string |
Branch to move (defaults to current branch). |
-y, --yes |
Skip confirmation prompt. |
parent¶
stackit parent [flags]
Show the parent of the current branch. Displays the name of the branch that is the parent of the current branch in the stack. This is useful for understanding the structure of your stack and seeing which branch the current branch is based on.
Flags:
| Flag | Description |
|---|---|
-h, --help |
help for parent |
pluck¶
stackit pluck [flags]
Pluck extracts a single branch from its current position and moves it to a new parent. Unlike 'move', pluck does NOT bring descendants along. The direct children of the plucked branch are reparented to the plucked branch's former parent (grandparent). This is useful when you realize a change doesn't belong in a stack and should be independent, or when reorganizing stacks without moving entire subtrees. Examples: stackit pluck --onto main # Pluck current branch to be a child of main stackit pluck --source feat-b --onto feat-x # Pluck feat-b onto feat-x If no --onto is specified, opens an interactive selector to choose the target. Note: This operation requires validation that rebases will succeed. If conflicts would occur, the pluck will abort without making any changes.
Flags:
| Flag | Description |
|---|---|
-h, --help |
help for pluck |
-o, --onto string |
Branch to pluck the source branch onto. |
--source string |
Branch to pluck (defaults to current branch). |
-y, --yes |
Skip confirmation prompt. |
pop¶
stackit pop [flags]
Delete the current branch but retain the state of files in the working tree. This is useful when you want to remove a branch from the stack but keep your uncommitted changes. The working tree will remain unchanged after the branch is deleted.
Flags:
| Flag | Description |
|---|---|
-h, --help |
help for pop |
precommit¶
stackit precommit [command]
Manage and run git pre-commit hooks that validate Stackit state.
Flags:
| Flag | Description |
|---|---|
-h, --help |
help for precommit |
prepush¶
stackit prepush [command]
Manage and run git pre-push hooks that prevent pushing locked branches.
Flags:
| Flag | Description |
|---|---|
-h, --help |
help for prepush |
rename¶
stackit rename [name] [flags]
Rename the current branch and update all stack metadata referencing it. If no branch name is supplied, you will be prompted for a new branch name. Note that this removes any association to a pull request, as GitHub pull request branch names are immutable.
Flags:
| Flag | Description |
|---|---|
-f, --force |
Allow renaming a branch that is already associated with an open GitHub pull request |
-h, --help |
help for rename |
reorder¶
stackit reorder [flags]
Reorder branches between trunk and the current branch, restacking all of their descendants. Opens an editor where you can reorder branches by moving around a line corresponding to each branch. After saving and closing the editor, the branches will be restacked in the new order.
Flags:
| Flag | Description |
|---|---|
-h, --help |
help for reorder |
restack¶
stackit restack [flags]
Ensure each branch in the current stack has its parent in its Git commit history, rebasing if necessary. If conflicts are encountered, you will be prompted to resolve them via an interactive Git rebase.
Flags:
| Flag | Description |
|---|---|
--branch string |
Which branch to run this command from. Defaults to the current branch. |
--downstack |
Only restack this branch and its ancestors. |
-h, --help |
help for restack |
--only |
Only restack this branch. |
--upstack |
Only restack this branch and its descendants. |
scope¶
stackit scope [name] [flags]
Manage the logical scope (e.g., Jira Ticket ID, Linear ID) for the current branch.
By default, branches inherit their scope from their parent. Using this command sets an
explicit override for the current branch and all its descendants.
To create a new branch with a scope, use 'stackit create --scope
Flags:
| Flag | Description |
|---|---|
-h, --help |
help for scope |
--show |
Show the current scope for this branch |
--unset |
Remove the explicit scope override from the current branch |
shell¶
stackit shell [command]
Output shell integration that enables automatic directory changes. When you create a stack with --worktree/-w, stackit will automatically change your shell's working directory to the new worktree. Add this to your shell configuration file:
For zsh (~/.zshrc):¶
eval "$(stackit shell zsh)"
For bash (~/.bashrc):¶
eval "$(stackit shell bash)"
For fish (~/.config/fish/config.fish):¶
stackit shell fish | source This is separate from shell completions. You likely want both: eval "$(stackit completion zsh)" eval "$(stackit shell zsh)"
Flags:
| Flag | Description |
|---|---|
-h, --help |
help for shell |
split¶
stackit split [flags]
Aliases:
split, sp
Split the current branch into multiple branches.
Has three forms: split --by-commit, split --by-hunk, and split --by-file.
split --by-commit slices up the commit history, allowing you to select split points.
split --by-hunk interactively stages changes to create new single-commit branches.
split --by-file
Flags:
| Flag | Description |
|---|---|
--above |
Insert new branch above current (as child, upstack) |
--as-sibling |
Create split branches as siblings instead of a chain |
--below |
Insert new branch below current (as parent, downstack) |
-c, --by-commit |
Split by commit - slice up the history of this branch |
-f, --by-file strings |
Split by file - extracts specified files to a new parent branch |
-F, --by-file-interactive |
Split by file (interactive) - select files to extract |
-h, --by-hunk |
Split by hunk - split into new single-commit branches |
--commit |
Alias for --by-commit |
--dry-run |
Preview what would happen without executing the split |
--file strings |
Alias for --by-file |
--help |
help for split |
--hunk |
Alias for --by-hunk |
-m, --message string |
Commit message for extraction (only with --by-file) |
-n, --name string |
Name for the new split branch (default: auto-generated) |
-p, --patch string |
Patch file specifying hunks to split (implies --by-hunk, defaults to --below, use "-" for stdin) |
squash¶
stackit squash [flags]
Squash all commits in the current branch into a single commit and restack upstack branches. This command combines all commits in the current branch into a single commit. After squashing, all upstack branches (children) are automatically restacked.
Flags:
| Flag | Description |
|---|---|
--edit |
Modify the existing commit message. (default true) |
-h, --help |
help for squash |
-m, --message string |
The updated message for the commit. |
-n, --no-edit |
Don't modify the existing commit message. Takes precedence over --edit |
submit¶
stackit submit [flags]
Idempotently force push all branches in the current stack from trunk to the current branch to GitHub, creating or updating distinct pull requests for each. Validates that branches are properly restacked before submitting, and fails if there are conflicts. Blocks force pushes to branches that overwrite branches that have changed since you last submitted or got them. Opens an interactive prompt that allows you to input pull request metadata.
Flags:
| Flag | Description |
|---|---|
--always |
Always push updates, even if the branch has not changed. |
--branch string |
Which branch to run this command from. Defaults to the current branch. |
--cli |
Edit PR metadata via the CLI instead of on web. |
--comment string |
Add a comment on the PR with the given message. |
-c, --confirm |
Reports the PRs that would be submitted and asks for confirmation before pushing branches and opening/updating PRs. |
-d, --draft |
If set, all new PRs will be created in draft mode. |
--dry-run |
Reports the PRs that would be submitted and terminates. No branches are restacked or pushed and no PRs are opened or updated. |
-e, --edit |
Input metadata for all PRs interactively. |
--edit-description |
Input the PR description interactively. |
--edit-title |
Input the PR title interactively. |
-f, --force |
Force push: overwrites the remote branch with your local branch. Otherwise defaults to --force-with-lease. |
-h, --help |
help for submit |
--ignore-out-of-sync-trunk |
Perform the submit operation even if the trunk branch is out of sync with its upstream branch. |
--merge-when-ready |
If set, marks all PRs being submitted as merge when ready. |
--no-assignees |
Don't apply default assignees from config. |
-n, --no-edit |
Don't edit any PR fields inline. |
--no-edit-description |
Don't prompt for the PR description. |
--no-edit-title |
Don't prompt for the PR title. |
--no-labels |
Don't apply default labels from config. |
-p, --publish |
If set, publishes all PRs being submitted. |
--rerequest-review |
Rerequest review from current reviewers. |
--restack |
Restack branches before submitting. |
--reviewers string |
If set without an argument, prompt to manually set reviewers. Alternatively, accepts a comma separated string of reviewers. |
-s, --stack |
Submit descendants of the current branch in addition to its ancestors. |
-t, --target-trunk string |
Which trunk to open PRs against on remote. |
--team-reviewers string |
Comma separated list of team slugs. |
-u, --update-only |
Only push branches and update PRs for branches that already have PRs open. |
-v, --view |
Open the PR in your browser after submitting. |
-w, --web |
Open a web browser to edit PR metadata. |
sync¶
stackit sync [flags]
Sync all branches with remote, prompting to delete any branches for PRs that have been merged or closed. Restacks all branches in your repository that can be restacked without conflicts. If trunk cannot be fast-forwarded to match remote, overwrites trunk with the remote version.
Flags:
| Flag | Description |
|---|---|
-a, --all |
Sync branches across all configured trunks |
--dry-run |
Preview metadata changes without applying them |
-f, --force |
Don't prompt for confirmation before overwriting or deleting a branch |
-h, --help |
help for sync |
--no-restack |
Skip restacking branches |
--restack |
Restack any branches that can be restacked without conflicts (default true) |
top¶
stackit top [flags]
Switch to the tip branch of the current stack. Prompts if ambiguous. This command navigates up the children chain from the current branch until it reaches a branch with no children (the tip of the stack). If multiple children exist at any level, you will be prompted to select which branch to follow.
Flags:
| Flag | Description |
|---|---|
-h, --help |
help for top |
track¶
stackit track [branch] [flags]
Start tracking the current (or provided) branch with stackit by selecting its parent. Can recursively track a stack of branches by specifying each branch's parent interactively. This command can also be used to fix corrupted stackit metadata.
Flags:
| Flag | Description |
|---|---|
-f, --force |
Sets the parent to the most recent tracked ancestor of the branch being tracked to skip prompts. Takes precedence over --parent |
-h, --help |
help for track |
-p, --parent string |
The tracked branch's parent. Must be set to a tracked branch. If provided, only one branch can be tracked at a time. |
trunk¶
stackit trunk [flags]
Show the trunk of the current branch. By default, displays the trunk branch that the current branch's stack is based on. Use --all to see all configured trunk branches, or --add to add an additional trunk.
Flags:
| Flag | Description |
|---|---|
--add string |
Add an additional trunk branch |
-a, --all |
Show all configured trunks |
-h, --help |
help for trunk |
ui¶
stackit ui [flags]
Open an interactive dashboard focused on shipping work to trunk. The dashboard shows all your stacks with their shippability status: ✓ Shippable - Ready to merge (approved, CI passing) ⏳ Pending - Waiting on CI or review ✗ Blocked - CI failed or changes requested ○ Incomplete - Missing PRs or drafts Select stacks to ship together, analyze combinations, and create consolidated PRs with a single action.
Flags:
| Flag | Description |
|---|---|
-h, --help |
help for ui |
--local-ci |
Run local CI validation when analyzing combinations |
undo¶
stackit undo [flags]
Restore the repository to a previous state before a Stackit command was executed. This command shows an interactive list of available undo points. Each undo point represents the state of the repository before a modifying Stackit command (like 'move', 'create', 'restack', etc.) was executed. If you specify a snapshot ID with --snapshot, it will restore to that specific state without prompting.
Flags:
| Flag | Description |
|---|---|
-h, --help |
help for undo |
--snapshot string |
Specific snapshot ID to restore (skips interactive selection) |
-y, --yes |
Skip confirmation prompt |
unfreeze¶
stackit unfreeze [branch] [flags]
Unfreeze specified branch and branches upstack of it locally. Unfreezing a branch re-enables local modifications and restacking. This only affects the local frozen status and does not affect shared locks.
Flags:
| Flag | Description |
|---|---|
-h, --help |
help for unfreeze |
unlock¶
stackit unlock [branch] [flags]
Unlock specified branch and branches upstack of it. Unlocking a branch re-enables local modifications and restacking for everyone by clearing the shared lock in remote metadata. If the branch is also frozen locally, you will still need to run 'st unfreeze' to enable modifications.
Flags:
| Flag | Description |
|---|---|
-h, --help |
help for unlock |
untrack¶
stackit untrack [branch] [flags]
Stop tracking the current (or provided) branch with stackit. If the branch has children, they will also be untracked.
Flags:
| Flag | Description |
|---|---|
-f, --force |
Will not prompt for confirmation before untracking a branch with children |
-h, --help |
help for untrack |
up¶
stackit up [steps] [flags]
Switch to the child of the current branch. Navigates up the stack away from trunk by switching to a child branch. By default, moves one level up. Use the --steps flag or pass a number as an argument to move multiple levels at once. If multiple children exist, you will be prompted to select one, unless the --to flag is used to specify a target branch to navigate towards.
Flags:
| Flag | Description |
|---|---|
-h, --help |
help for up |
-n, --steps int |
The number of levels to traverse upstack. (default 1) |
--to string |
Target branch to navigate towards. When multiple children exist, selects the path leading to this branch. |
worktree¶
stackit worktree [command]
Aliases:
worktree, wt
Manage stackit-managed worktrees. Worktrees allow you to work on multiple stacks in parallel, each in its own directory. Create a worktree with 'stackit worktree create' from trunk.
Flags:
| Flag | Description |
|---|---|
-h, --help |
help for worktree |
Global Flags¶
These flags are available on all stackit commands:
| Flag | Description |
|---|---|
--cwd <path> |
Working directory in which to perform operations |
--debug |
Write debug output to the terminal |
--interactive |
Enable interactive features like prompts, pagers, and editors (default: true) |
--no-interactive |
Disable all interactive features |
--verify |
Enable git hooks (pre-commit, etc.) (default: true) |
--no-verify |
Disable git hooks |
--quiet, -q |
Minimize output to the terminal (implies --no-interactive) |