gh-pr-tree
is a GitHub CLI extension that helps you visualize the dependency tree of pull requests.
Normally, gh pr list --base <branch>
only shows the direct PRs targeting a branch. With gh-pr-tree
, you can see all descendants recursively as a hierarchical tree, making it easier to track stacked PRs and feature branch chains.
gh
commandjq
command
- Download
gh-pr-tree
- Make it executable chmod +x gh-pr-tree
- Copy gh-pr-tree into a bin PATH:
mkdir -p ~/.local/bin mv gh-pr-tree ~/.local/bin/ export PATH="$HOME/.local/bin:$PATH"
- To make it permanent add the export to your
~/.bashrc
or~/.zshrc
gh-pr-tree <base-branch>
gh-pr-tree feature-x
π± PR tree starting from base: feature-x
ββ PR #12: Initial adjustments (head: feature-y)
β ββ PR #15: Validation fixes (head: feature-z)
β β ββ PR #18: Final refactor (head: feature-w)
β ββ PR #16: Docs update (head: feature-docs)
ββ PR #20: UI improvements (head: feature-ui)