Create pull request
Use gh for all GitHub PR tasks. The PR describes all commits on the
branch since it diverged from base — not only the latest.
Before creating
Run in parallel:
git status— untracked filesgit diff— staged and unstaged- Branch tracking vs remote (
git status/git branch -vv) git logandgit diff [base]...HEAD— full branch history since diverging from base
Create PR
- Push if needed:
git push -u origin HEAD(requires network permission) - Create:
gh pr create --title "title" --body "$(cat <<'EOF'
## Summary
- ...
## Test plan
- [ ] ...
EOF
)"
- Return the PR URL to the user.
Rules
- NEVER update git config
- Push only the current branch; never force-push
- Use HEREDOC for body formatting
- Complete sentences in title and summary