Skip to content

git-spice

git-spice is a tool for stacking Git branches. It lets you manage and navigate stacks of branches, conveniently modify and rebase them, and create GitHub Pull Requests from them.

It works with Git instead of trying to replace Git. Introduce it in small places in your existing workflow without changing how you work wholesale.

# Create a branch $ git checkout -b feat1 $ gs branch track # Or $ gs branch create feat1 # Restack a branch $ git rebase -i base # Or $ gs branch restack
# Restack all branches $ gs stack restack # Submit a PR $ gs branch submit # Submit all PRs $ gs stack submit # Sync with trunk $ gs repo sync

What is stacking?

Stacking refers to the practice of creating branches or pull requests that build on top of each other. It allows chaining interdependent changes together, while still keeping the individual changes small and focused.

See also FAQ > What is stacking?

Get started Learn more

Features

  • Branch management


    Create, edit, and navigate stacks of branches with ease. With git-spice's branch management commands, you can keep your stack in sync with the trunk branch, automatically rebase dependent branches, and more.

  • Pull Request Management


    Create GitHub Pull Requests from your stack with a single command. git-spice can create a PR for the current branch, PRs for the entire stack, or parts of the stack. If a branch already has a PR, git-spice will update it. If a PR is merged, git-spice will automatically restack branches that depend on it.

  • Incremental improvements


    git-spice does not need to be adopted all at once. It does not expect you to flip your entire workflow upside down. Incorporate it into your workflow at your own pace, one feature at a time.

  • Offline-first


    git-spice operates entirely locally. It talks directly to Git, and when you ask for it, to GitHub. All state is stored locally in your Git repository. A network connection is not required, except when pushing or pulling.

  • Intuitive shorthands


    Most commands in git-spice have easy-to-remember shorthands. For example, gs branch create can be shortened to gs bc. Explore the list of shorthands with --help or at Shorthands. We recommend adopting these incrementally.

  • Free and open-source


    git-spice is free and open-source software. It is made available under the GPL-3.0 license. You may use it to develop proprietary software, but any changes you make to git-spice itself must be shared.