Gh pr checkout
Agent skills for GitHub CLI
npx -y skills add dceoy/github-cli-agent-skills --skill gh-pr-checkoutAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Check out a GitHub pull request locally using gh CLI to review or test changes.
SKILL.md
2.1 KB, 480 tokens by cl100k_base, as published. Nobody here has run it
GitHub PR Checkout
When to use
- The user asks to check out a PR locally.
- You need to test or review PR changes on your machine.
- Switching between PRs for code review.
Inputs to confirm
- PR number, URL, or branch name.
- Custom local branch name (optional).
- Target repo if not current (
--repo OWNER/REPO).
Workflow
-
Verify auth and git status:
gh --version gh auth status git status -
Check out the PR:
gh pr checkout 123 gh pr checkout https://github.com/OWNER/REPO/pull/123 gh pr checkout feature-branch -
Use options as needed:
# Custom local branch name gh pr checkout 123 --branch my-review-branch # Force update existing branch gh pr checkout 123 --force # Detached HEAD (no local branch) gh pr checkout 123 --detach -
After checkout, verify:
git branch --show-current git log --oneline -5
Examples
# Check out PR #123
gh pr checkout 123
# Check out with custom branch name
gh pr checkout 123 --branch review-feature-x
# Force refresh an already checked out PR
gh pr checkout 123 --force
# Interactive selection from recent PRs
gh pr checkout
Flags reference
| Flag | Description |
|---|---|
-b, --branch | Local branch name (default: head branch name) |
--detach | Checkout with detached HEAD |
-f, --force | Reset existing local branch to PR state |
--recurse-submodules | Update submodules after checkout |
Notes
- Without arguments, interactively select from recent PRs.
- The
--forceflag is useful when PR has been updated. - Use
--detachfor quick inspection without creating a branch.
References
- GitHub CLI manual: https://cli.github.com/manual/
gh pr checkout --help
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.