Visualize stacked pull requests in a tree format.
Note: This command works within a single repository. It does not cover multiple repos at this time.
gh extension install yusufhilmi/gh-pr-stackRun this command inside a git repository:
gh pr-stackOPEN PR STACKS
+145 −23 (8 files)
main <- feature-auth
https://github.com/user/repo/pull/42
+67 −12 (4 files)
feature-auth <- feature-auth-tests
https://github.com/user/repo/pull/43
+234 −89 (12 files)
feature-auth <- feature-auth-oauth [DRAFT]
https://github.com/user/repo/pull/44
+45 −3 (2 files)
feature-auth-oauth <- feature-auth-oauth-google
https://github.com/user/repo/pull/45
+89 −34 (6 files)
main <- feature-dashboard
https://github.com/user/repo/pull/46
Shows all open PRs (including drafts) in a stacked structure based on their base branches.
+additions −deletions (files changed)shows diff statistics- Green for additions
- Red for deletions
- Orange for file count
base <- headshows branch relationship (matching GitHub UI)- Purple for base branch
- Draft PRs are marked with
[DRAFT] - Indentation shows PR dependencies
- Empty lines separate sibling branches and root-level stacks
Since I prefer monorepos, didnt implement this but if you feel like it, feel free to contribute.
Include PRs from other repositories (same owner):
gh pr-stack --include backend,frontend
gh pr-stack --include backend frontendInclude repos from different owners:
gh pr-stack --include other-org/repogh pr-stack --include backend,frontendOPEN PR STACKS
[frontend]
+120 −45 (7 files)
main <- feature-auth
https://github.com/user/frontend/pull/42
[backend]
+89 −23 (5 files)
main <- feature-auth
https://github.com/user/backend/pull/15
+12 −8 (2 files)
main <- fix/api-bug
https://github.com/user/backend/pull/16
Use --match to group PRs with matching branch names across repos:
gh pr-stack --include backend,frontend --matchOPEN PR STACKS
[UNIFIED frontend backend]
+120 −45 (7 files)
main <- feature-auth
https://github.com/user/frontend/pull/42
+89 −23 (5 files)
main <- feature-auth
https://github.com/user/backend/pull/15
+12 −8 (2 files)
main <- fix/api-bug
https://github.com/user/backend/pull/16