github-create-pr
1
总安装量
1
周安装量
#45604
全站排名
安装命令
npx skills add https://github.com/pc-style/pc-skills --skill github-create-pr
Agent 安装分布
kilo
1
windsurf
1
trae
1
opencode
1
codex
1
Skill 文档
GitHub Create PR
Create a GitHub Pull Request using the gh CLI.
When to Use
- Ready to submit changes for review
- Need to create a pull request
- Any request to “open PR”, “create PR”, or “submit for review”
Prerequisites
Ensure gh CLI is installed and authenticated:
gh --version
gh auth status
If not authenticated:
gh auth login
Workflow
1. Check Branch Status
git status
git branch --show-current
git log --oneline -5
2. Push Branch (if needed)
git push -u origin HEAD
3. Create the PR
Quick creation with defaults:
gh pr create
With custom title:
gh pr create --title "feat: add user authentication"
With title and body:
gh pr create --title "feat: add user authentication" --body "Implements OAuth2 login flow with support for Google and GitHub providers."
Fill from commit messages:
gh pr create --fill
Target specific base branch:
gh pr create --base main
4. Copy PR URL
After creation, the PR URL is printed. You can also get it with:
gh pr view --json url --jq '.url'
Common Options
| Flag | Description |
|---|---|
--title |
PR title |
--body |
PR description |
--fill |
Use commit message as title/body |
--base |
Target branch (default: repo default) |
--head |
Source branch (default: current) |
--draft |
Create as draft PR |
--label |
Add labels |
--assignee |
Assign to user(s) |
--reviewer |
Request reviewer(s) |
Examples
Create draft PR:
gh pr create --draft --title "WIP: refactor API"
Add labels and reviewer:
gh pr create --title "fix: resolve memory leak" --label "bug" --reviewer "@username"
Use template:
gh pr create --template="feature.md"
Best Practices
- Push branch before creating PR
- Write clear, descriptive titles
- Include context in body (what changed, why)
- Reference related issues:
Closes #123 - Add appropriate labels
- Request reviewers
- Use draft PRs for work-in-progress