Use other tools with stacked pull requests - GitHub Docs
https://docs.github.com/en/pull-requests/reference/use-other-tools-with-stacked-pull-requests • 141 KB fetched Open original page
Use other tools with stacked pull requests - GitHub Docs Skip to main content
GitHub Docs Version: Free, Pro, & Team
Search or ask Copilot Search or ask Copilot
Select language: current language is English
Search or ask Copilot Search or ask Copilot
Open menu
Collapse sidebar Expand sidebar
Scroll breadcrumbs left
* Home
* Pull requests
* Reference
* Stacked PRs and other tools
Scroll breadcrumbs right
Pull requests
*
*
* Get started
* About pull requests
* About stacked PRs
* About forks
* Pull request quickstart
* Stacked PRs quickstart
* Review quickstart
* Concepts
* Write code
* Help others review your changes
* Give reviews
* Resolve reviews
* Deploy code
* How-tos
* Commit changes
* Manage branches
* Commit to PR branch from fork
* Create a commit with multiple authors
* Change a commit message
* Compare commits
* Troubleshoot commits
* Create pull requests
* Create a pull request
* Create stacked PRs
* Create a PR from a fork
* Draft pull requests
* Manage stacked PRs
* Update the head branch
* Change the base branch
* Request a PR review
* Stacked pull requests
* Review pull requests
* Check out a PR locally
* Review proposed changes
* Review stacked PRs
* Review dependency changes
* Comment on a PR
* Approve PRs
* View a PR review
* Dismiss a PR review
* Incorporate feedback
* Merge and close
* Resolve merge conflicts
* Resolve merge conflicts in Git
* Troubleshoot status checks
* Troubleshoot stacked PRs
* Merge a pull request
* Merge PR with merge queue
* Merge PR automatically
* Merge stacked PRs
* CI for stacked PRs
* Revert a pull request
* Close a pull request
* Work with forks
* Fork a repository
* Configure a remote repository
* Sync a fork
* Allow changes to a branch
* Detach a fork
* Reference
* Pull requests
* Stacked pull requests
* Stacked PRs CLI commands
* Stacked PRs APIs and webhooks
* Branches
* Forks
* Commits
* Stacked PRs and other tools
* Using query parameters to create a pull request
* PR reviews
* Status checks
* Pull request merges
* Merge conflicts
* Manage and standardize pull requests
* Tutorials
* Stack pull requests
* Roll out stacked PRs
Use other tools with stacked pull requests
Use stacked pull requests with tools like Jujutsu, Sapling, or git-town.
Copy as Markdown
In this article
* Linking branches as a stack
* Adding to an existing stack
* Setting a base branch or opening pull requests
* Adopting branches for full local tracking
* Further reading
Note
This feature is in public preview and subject to change.
Stacked pull requests are built on standard Git branches and regular pull requests, so you can choose to use tools other than the gh stack CLI for your local workflow. If you manage branch chains with another tool, such as Jujutsu (jj), Sapling, or git-town, you can use the gh stack link command to open those branches as a stack on GitHub.
The gh stack link command only calls the GitHub API to create the stacked pull requests — it does not create any local tracking. If a branch already has an open pull request, link uses it; otherwise it creates a draft pull request with the correct base branch.
Linking branches as a stack
*
Create your chain of branches locally with your tool of choice. For example, with Jujutsu:
jj new main -m "first change"
jj bookmark create change1 --revision @
jj new -m "second change"
jj bookmark create change2 --revision @
jj new -m "third change"
jj bookmark create change3 --revision @
*
Push the branches and link them as a stack, listed from bottom to top.
gh stack link change1 change2 change3
This pushes the branches, creates a pull request for each one with the correct base, and links them as a stack on GitHub.
Adding to an existing stack
To add more branches to a stack you created with link , run gh stack link again with the full list of pull requests and branches in the stack, from bottom to top. You can refer to existing pull requests by number.
gh stack link 123 124 125 change4 change5
Setting a base branch or opening pull requests
By default, link targets your repository's default branch and creates draft pull requests. To change this behavior:
* Use --base to specify a different trunk branch.
* Use --open to mark the pull requests as ready for review instead of draft.
gh stack link --base develop --open change1 change2 change3
Adopting branches for full local tracking
If you want full local stack tracking — so you can use commands like gh stack rebase , gh stack sync , and stack navigation — adopt your existing branches with gh stack init instead, then submit them.
gh stack init change1 change2 change3
gh stack submit
Further reading
* Stacked pull requests
Back to top
Help and support
Was this Doc helpful?
Yes No
Help us make GitHub Docs great!
All Docs are open source. See something that's wrong or unclear? Submit a pull request.
Make a contribution
Still need help?
Ask the GitHub community Contact support Expert services Blog
GitHub Inc. © 2026 Terms Privacy Status Pricing
Links found on this page
- Skip to main content [direct]
- GitHub Docs [direct]
- Pull requests [direct]
- Reference [direct]
- About pull requests [direct]
- About stacked PRs [direct]
- About forks [direct]
- Pull request quickstart [direct]
- Stacked PRs quickstart [direct]
- Review quickstart [direct]
- Write code [direct]
- Help others review your changes [direct]
- Give reviews [direct]
- Resolve reviews [direct]
- Deploy code [direct]
- Manage branches [direct]
- Commit to PR branch from fork [direct]
- Create a commit with multiple authors [direct]
- Change a commit message [direct]
- Compare commits [direct]
- Troubleshoot commits [direct]
- Create a pull request [direct]
- Create stacked PRs [direct]
- Create a PR from a fork [direct]
- Draft pull requests [direct]
- Manage stacked PRs [direct]
- Update the head branch [direct]
- Change the base branch [direct]
- Request a PR review [direct]
- Stacked pull requests [direct]
- Check out a PR locally [direct]
- Review proposed changes [direct]
- Review stacked PRs [direct]
- Review dependency changes [direct]
- Comment on a PR [direct]
- Approve PRs [direct]
- View a PR review [direct]
- Dismiss a PR review [direct]
- Incorporate feedback [direct]
- Resolve merge conflicts [direct]
- Resolve merge conflicts in Git [direct]
- Troubleshoot status checks [direct]
- Troubleshoot stacked PRs [direct]
- Merge a pull request [direct]
- Merge PR with merge queue [direct]
- Merge PR automatically [direct]
- Merge stacked PRs [direct]
- CI for stacked PRs [direct]
- Revert a pull request [direct]
- Close a pull request [direct]
- Fork a repository [direct]
- Configure a remote repository [direct]
- Sync a fork [direct]
- Allow changes to a branch [direct]
- Detach a fork [direct]
- Pull requests [direct]
- Stacked pull requests [direct]
- Stacked PRs CLI commands [direct]
- Stacked PRs APIs and webhooks [direct]
- Branches [direct]
- Forks [direct]
- Commits [direct]
- Using query parameters to create a pull request [direct]
- PR reviews [direct]
- Status checks [direct]
- Pull request merges [direct]
- Merge conflicts [direct]
- Manage and standardize pull requests [direct]
- Stack pull requests [direct]
- Roll out stacked PRs [direct]
- Make a contribution [direct]
- Ask the GitHub community [direct]
- Contact support [direct]
- Expert services [direct]
- Blog [direct]
- Terms [direct]
- Privacy [direct]
- Status [direct]
- Pricing [direct]
|
|