
Security News
GitHub Actions Checkout Now Blocks Risky pull_request_target Checkouts
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.
git-stack-cli
Advanced tools
git stackgitgit revise[!TIP]
Install via Homebrew to ensure the official Github CLI and git revise dependencies are installed automatically
brew install magus/git-stack/git-stacknpm alternative
If you prefer to use npm you will need to install the official Github CLI and git revise dependencies separarely
brew install gh brew install git-revise npm i -g git-stack-cli
git stack # group and sync commits in branch to Github
git stack --check # print status only, skipping rebase and sync to Github
git stack --verbose # print more detailed logs for debugging internals
git stack --no-verify # skip git hooks such as pre-commit and pre-push
git stack help # print a table of all CLI arguments
Adding commits to a PR is as simple as running git stack and adding commits to a PR.
git stackc to create a new PR↑↓ and space/enter to navigate and assign commits to the PRs to sync created PRs and commits to Githubmaster branchBy default PRs are stacked based on the order of commits in your branch.
To separate a PR and base it on your master branch press m.
Sometimes you want to add changes to an existing commit or pull request.
With git-stack this is as simple as amending the commit.
git add -p your changes to the stagegit stack log to find the relative commit number you want to amendgit stack fixup <number> to amend the specific commit with your staged changes.git add -p
git stack log
git stack fixup 2
Running git stack afterward will update any existing pull requests with your changes.
To update your local branch with the latest changes in the remote branch (e.g. master, main)
git stack rebase
By default git stack generates a unique identifier and appends it to your local branch name.
For example, if you are locally working in dev/feature-a, PRs branch names will look like dev/feature-a-3cmrMBSUj.
git stack has many optional flags to control its behavior.
You can view them by running git stack help and set them as needed.
If you prefer to set them once in your environment, you can use the command below to generate a one-time configuration.
❯ git stack config --draft --force
Add the line below to your shell rc file (.zshrc, .bashrc, etc.)
export GIT_STACK_CONFIG="{\"draft\":true,\"force\":true}"
Copy this environment variable into your shell configuration, e.g. .zshrc, .bashrc, etc.
The goal of git stack is to combine the simplicity of developing in a single branch in order to preserve your commit history while also grouping commits into pull requests for code review.
Often pushing all your commits to a single pull request is the simplest and fastest approach to development. This comes at a price, your teammates have to review larger, less related pieces of code and you will lose some of your atomic commit history if you "Squash and merge".
When you decide to break changes up into multiple diffs that depend on one another this process is commonly referred to as stacked diffs (pull requests that depend on other pull requests).
This approach is popular at many major companies such as Twitter, Facebook, etc.
Managing stacked diffs manually involves managing multiple local branches, jumping between them, rebasing, etc.
This process gets even more complicated when you start getting feedback in code review and have to update individual branches.
Managing even a few stacked diffs requires a relatively strong knowledge of git, even with tricks like --update-refs.
xghstackgit stack automatically synchronizes each pull request in your stack, as neededgit stack does not create local branches (instead it annotates commits locally with metadata to denote groups of commits, e.g. git-stack-id: E63ytp5dj)ghstack requires rebasing and squashing since each commit creates a pull request, which means you lose commit historygit stack allows developing in a single local branch and selecting groups of commits for each pull requestgit stack adds a clear comment to each pull request in the stack showing the entire stackgit stack does not break if you land pull requests through Github directly, ghstack requires landing from the CLI interfacegit stack uses the official GitHub CLI (gh) instead of personal access tokensEnsure node --version is the same across both projects you are using to test the git-stack cli
corepack enable
git submodule update --init --recursive
pnpm i
pnpm run dev
node --enable-source-maps ./dist/js/index.js
pnpm run compile
./dist/js/with-sourcemaps/git-stack-bun-darwin-arm64 --no-sync
[!IMPORTANT]
You must update the
versioninpackage.jsonbefore runningpnpm run release. DO NOT usenpm versionor commit the change, the release scripts handle git tags etc.
pnpm run release
# release individually
pnpm run release:npm
pnpm run release:github
pnpm run release:brew
FAQs
Unknown package
The npm package git-stack-cli receives a total of 200 weekly downloads. As such, git-stack-cli popularity was classified as not popular.
We found that git-stack-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.