GitHub PR Create
When to use
- The user asks to open a pull request.
- You need to create a draft or request reviews.
Inputs to confirm
- Base branch and head branch (if not current).
- Title/body or whether to use
--fill. - Draft status, reviewers, labels, assignees, milestone, project.
- Target repo if not current (
--repo OWNER/REPO).
Workflow
- Verify auth:
gh --version gh auth status - Create the PR:
gh pr create --title "Fix auth" --body "Fixes #123" --base main gh pr create --fill --draft --reviewer "alice" - Optional: web flow or template:
gh pr create --web gh pr create --template "pull_request_template.md"
Examples
# Draft PR with auto-filled title/body
~ gh pr create --fill --draft
Notes
- Mention
Fixes #123/Closes #123in the PR body to auto-close issues on merge. --headsupportsuser:branchto target a fork.- Adding to projects may require
gh auth refresh -s project.
References
- GitHub CLI manual: https://cli.github.com/manual/
gh pr create --help