Your branch survived the squash. Now rebase it properly.
When a parent PR in your stack gets squash-merged, a plain git rebase doesn't know what GitHub knows. It replays commits that are already in the base — just wearing a different SHA — and chaos follows.
gh-rebased asks GitHub which commits got squashed, drops them before the rebase runs, and gets out of your way.
your branch, rebased.
gh extension install stephenc-ori/gh-rebasedFrom your stacked branch, after the parent PR has been squash-merged:
gh rebasedThat's it. It fetches the target branch, detects squash-merged parent commits, and runs the rebase — dropping only what's already been incorporated upstream.
- Finds the open PR for your current branch and its target branch
- Fetches
origin/<target>and computes the divergence point - For each new commit on the target, asks GitHub which PR it came from
- If one new commit maps to a PR with multiple original commits → squash merge detected
- Drops those original commits via
GIT_SEQUENCE_EDITORbeforegit rebase -iruns - Rebase merges and single-commit PRs are left alone —
git rebasehandles those via patch-ID matching
These tools take a broader approach to stacked PR workflows:
- git-machete — full branch relationship manager with rebase automation across the whole stack
- gh-stack — GitHub's official stacked PR extension; handles cascading rebases and PR creation
- gh-domino — rebases stacked PRs like dominoes when one in the chain is merged
gh-rebased is narrower: it does one thing, on one branch, when you need it.
MIT