stak
Minimal stacked changes for git. A lightweight alternative to Graphite, ghstack, and git-branchless.
What is it?
Build big features as a chain of small, reviewable branches:
main → auth-types → auth-service → auth-ui
Each branch builds on the previous. Submit all for review at once. When you edit a lower branch, one command updates everything above.
Install
# Homebrew (macOS/Linux)
brew install memorypasta/tap/stak
# npm
npm install -g stak-git
# pip / uv
pip install stak-git
# Direct install
curl -fsSL https://raw.githubusercontent.com/memorypasta/stak/main/packaging/install.sh | bash
Commands
| Command | Description |
|---|---|
stak new <name> |
Create branch on top of current |
stak insert |
Insert branch at any position (fzf) |
stak split |
Split current branch's commits (fzf) |
stak up / down |
Move up or down the stack |
stak goto |
Jump to branch (fzf interactive) |
stak status |
Show the stack |
stak sync |
Rebase entire stack |
stak continue |
Continue after resolving conflicts |
stak abort |
Abort current rebase |
stak push |
Push branches (fzf multi-select) |
stak push -a |
Push all branches |
stak drop |
Remove top branch |
stak fold |
Fold branch (fzf interactive) |
stak fold --down |
Fold into child (non-interactive) |
stak land |
Clean up after PR merge |
stak log |
View commits (fzf interactive) |
stak log -a |
Show all branches |
stak ls |
List all stacks |
stak use |
Switch to stack (fzf interactive) |
stak use <name> |
Switch/create stack by name |
stak rm-stack |
Delete a stack (fzf interactive) |
stak setup-interactive |
Install fzf |
Disable Interactive Mode
export STAK_NO_INTERACTIVE=1
stak push # pushes all without fzf prompt
Basic Workflow
git checkout main
# Build feature in parts
stak new auth-types
# ... commit ...
stak new auth-service
# ... commit ...
stak new auth-ui
# ... commit ...
# See the stack
stak status
# main
# auth-types (2 commits)
# auth-service (3 commits)
# → auth-ui (4 commits)
# Push all for review
stak push
Editing a Lower Branch
# Go back to fix something
stak down
stak down
# ... fix and commit ...
# Update everything above
stak sync
# Push updates
stak push
Handling Conflicts
stak sync
# Conflict in auth-service!
# Fix the conflict in your editor
git add .
stak continue # continues sync
# Or abort and try differently
stak abort
Combining Branches
Fold up (into parent - keep parent's name):
# Combine auth-service into auth-types
stak down # go to auth-service
stak fold # fold up into auth-types
# main
# → auth-types (combined)
# auth-ui
Fold down (into child - keep child's name):
# Combine auth-service into auth-ui
stak down # go to auth-service
stak fold --down # fold down into auth-ui
# main
# auth-types
# → auth-ui (combined)
After PR Merges
# auth-types PR merged to main
stak land # removes auth-types, rebases rest onto main
# Stack is now:
# main
# → auth-service
# auth-ui
Multiple Stacks
Work on different features simultaneously:
# Create stacks for different features
stak use auth-feature # creates & switches
stak new auth-types
stak new auth-service
stak use billing-feature # creates & switches
stak new billing-api
stak new billing-ui
# Switch between them
stak use auth-feature
# List all stacks
stak ls
# ● auth-feature (2 branches) ◀ current
# ○ billing-feature (2 branches)
# Delete when done
stak rm-stack billing-feature
Each stak tracks its own chain of branches independently.
Why stak?
| Tool | Complexity | Dependencies | Works with any Git host |
|---|---|---|---|
| stak | Minimal | Just bash + git | ✅ Yes |
| Graphite | Full platform | Requires account | ❌ GitHub only |
| ghstack | Medium | Python | ❌ GitHub only |
| git-branchless | High | Rust binary | ✅ Yes |
Philosophy
- Minimal: Only commands you need for stacked changes
- Transparent: Just git branches. Use git directly anytime.
- No magic: Stacks stored in
.git/stacks/, one branch per line - Conflict-friendly: Resolve normally, then
stak continue
Tips
- Keep stacks shallow (2-3 branches). Deep stacks = more conflicts.
- Commit before running
sync,fold, ordrop. - Use
stak statusoften to see where you are. - You can always use raw git commands - stak just helps manage the chain.
- Run
stak setup-interactiveto install fzf for interactive navigation.
License
MIT
Metadata
Release files for stak-git 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| stak_git-1.0.4.tar.gz | 21.0 kB | Without provenance | Details for stak_git-1.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| stak_git-1.0.4-py3-none-any.whl | Python 3 | none | any | Details for stak_git-1.0.4-py3-none-any.whl |
Total release size: 43.5 kB
Release files / stak_git-1.0.4.tar.gz
| Download URL | stak_git-1.0.4.tar.gz |
|---|---|
| Size | 21.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4f984aa23630f54816bb3e85ba1978271e36c736dc0e8751f374df72cf0b65d8
|
|
BLAKE2b-256 checksum How to use checksums |
6f4eee24a857a0a7af98926b83231c0693947e928fd303533ac7733f144bdf5c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.5
|
Release files / stak_git-1.0.4-py3-none-any.whl
| Download URL | stak_git-1.0.4-py3-none-any.whl |
|---|---|
| Size | 22.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6835592c94aa270b0a2e228f46c230953b9981c4dbb6f24ab45e5da87a848982
|
|
BLAKE2b-256 checksum How to use checksums |
de486278d300da6365b1965718ec3b085d75631055973685892c74944284d166
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.5
|
Security for stak-git 1.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.