gh pr checkout adds --worktree PATH
Introduced 2026-08-20 · score 0.98
HOW TO USE IT
When checking out a pull request into a separate Git worktree, use `gh pr checkout` with `--worktree <path>`.
gh pr checkout 12 --worktree ../wt-featuregh pr checkout <number|url|branch> --worktree <path>WHY THIS HELPS
Check out a pull request into a separate Git worktree while working on a repository.
REQUIREMENTS AND LIMITATIONS
- Version: v2.98.0
- <number|url|branch>: Pull request number, URL, or branch to check out. If omitted, the manual shows interactive selection.
- --worktree <path> (required): Check out the pull request into a worktree at the given path.
- Prerequisite: Use GitHub CLI v2.98.0 or later; the flag was introduced in v2.98.0.
- Prerequisite: Authenticate with `gh auth login` or provide `GITHUB_TOKEN`.
FIRST-PARTY EVIDENCE
- https://github.com/cli/cli/releases/tag/v2.98.0
- https://cli.github.com/manual/gh_pr_checkout
- https://cli.github.com/manual/index
Check the installed version and the source before using it. Entry JSON