GitHub CLI Shortcuts for Creating Pull Requests from Terminal

User avatar placeholder
Written by Tamzid Ahmed

June 1, 2026

As a developer who manages hundreds of pull requests yearly, I’ve found that using GitHub CLI (gh) for PR creation slashes time spent switching contexts and reduces manual errors. This guide delivers battle-tested shortcuts to create pull requests directly from your terminal—no browser, no mouse clicks, just pure efficiency.

Why GitHub CLI for Pull Requests?

Manual PR creation through the browser wastes precious minutes per request: switching tabs, filling forms, and navigating menus. GitHub CLI eliminates these friction points by letting you create, review, and manage PRs entirely in your terminal. For teams practicing continuous integration, this workflow keeps developers in their coding flow while maintaining GitHub’s full feature set.

Essential gh pr create Shortcuts

These commands cover 95% of daily PR needs. Memorize them to cut creation time to under 10 seconds.

Basic PR from Current Branch

When your current branch is ready, run:

gh pr create

This auto-detects your branch and default base branch (like main). You’ll see a simple prompt for title/description. For most teams, this is the fastest way to open a PR without leaving your terminal.

Auto-Fill Title and Description

Use commit messages to auto-populate PR details:

gh pr create --fill

This pulls the latest commit message for the title and concatenates all recent commit messages for the body. I’ve seen it save 3-5 minutes per PR by eliminating manual typing. Perfect for small, focused changes.

Specify Base and Head Branches Explicitly

Need to push from a non-default branch? Use:

gh pr create -b main -h feature-branch

Replace main with your target branch and feature-branch with your source branch. This avoids context switching to check branch names and works seamlessly with CI pipelines.

Create Draft PRs for WIP

For work-in-progress branches:

gh pr create --draft

Draft PRs prevent premature reviews while keeping changes visible. Use this when collaborating on complex features or when waiting for dependent code.

Add Reviewers and Assignees Instantly

Assign reviewers during creation with:

gh pr create --reviewer "alice" --assignee "bob"

Replace alice and bob with GitHub usernames. This bypasses the manual assignment step and ensures the right people see your PR immediately.

Pro Tips for Maximum Efficiency

Level up your workflow with these advanced tactics:

  • Combine with fzf for fuzzy branch selection: gh pr create -b $(git branch | fzf) to pick base branches interactively
  • Use shell aliases for repetitive commands: alias gpr="gh pr create --fill --reviewer "team""
  • Open PRs in browser post-creation: gh pr view --web for quick visual review
  • Pair with ripgrep to search commit history for PR descriptions: rg "fix" | fzf before running gh pr create --fill

Key Tradeoffs to Consider

While GitHub CLI accelerates PR creation, note these nuances:

  • Complex descriptions: For detailed PRs requiring rich formatting (e.g., tables), the browser UI remains superior
  • Large teams: With 50+ reviewers, the CLI’s --reviewer flag may be slower than the web UI’s bulk selection
  • Initial setup: Requires GitHub CLI installation and authentication (gh auth login), but this is a one-time 2-minute task

For most daily PRs—especially small, iterative changes—the terminal workflow delivers unmatched speed. Reserve the browser for complex reviews or when using GitHub’s advanced features like code owners.

Conclusion

Mastering GitHub CLI shortcuts transforms pull request creation from a context-switching chore into a seamless terminal workflow. By using commands like gh pr create --fill and gh pr create --reviewer, you eliminate browser navigation, reduce manual errors, and keep your focus on coding. Start with the basic gh pr create command today, then gradually adopt the advanced flags that match your team’s workflow. For maximum impact, combine these with fzf for branch selection and shell aliases for repetitive tasks. Your future self will thank you for every minute saved.

Leave a Comment