Installation¶
Requirements¶
- Git 2.36+ — required, not optional. Stack operations use
git worktree list -zto see which branches are checked out where, and stackit refuses to run them on older Git rather than guess. - GitHub CLI (
gh) for PR operations
Check your version with git --version. Some still-supported distributions ship
older Git than this — Ubuntu 22.04 has 2.34 and Debian 11 has 2.30 — so you may
need to upgrade Git before stackit will work. Run stackit doctor after
installing to confirm your environment.
Homebrew (macOS and Linux)¶
The easiest way to install stackit is via Homebrew:
brew install getstackit/tap/stackit
After installation, you can use either stackit or st (short alias).
Shell integration¶
Recommended
Enable shell integration to automatically change directories when creating worktrees with stackit create -w.
Add one of the following to your shell configuration:
# ~/.zshrc
eval "$(stackit shell zsh)"
# ~/.bashrc
eval "$(stackit shell bash)"
# ~/.config/fish/config.fish
stackit shell fish | source
This is separate from shell completions. You likely want both:
# zsh example:
eval "$(stackit completion zsh)"
eval "$(stackit shell zsh)"
Shell completions¶
Enable tab completion for stackit commands:
# ~/.zshrc
eval "$(stackit completion zsh)"
# ~/.bashrc
eval "$(stackit completion bash)"
# ~/.config/fish/config.fish
stackit completion fish | source
Verify installation¶
Check that stackit is installed correctly:
stackit --version
Initialize your repository¶
In your Git repository, run:
stackit init
This command:
- Detects your trunk branch (usually
mainormaster) - Prepares the repository for stacking
- Offers to install optional integrations:
- GitHub Actions — CI checks for branch locking
- Git hooks — Prevent commits and pushes to locked branches (learn more)
- AI agent files — Integration files for Claude Code, Codex, and Cursor
You can skip the interactive prompts with stackit init --skip-integrations or install integrations later using the individual commands (stackit github install, stackit precommit install, stackit prepush install, stackit agent install).