Pull Requests
A pull request proposes merging one branch into another and is where review happens.
A pull request (PR) asks the maintainers to pull your branch's changes into theirs. It is the heart of collaboration on GitHub.
Opening a PR
- Push your feature branch.
- GitHub shows a Compare & pull request banner — click it.
- Write a clear title and description of what and why.
- Request reviewers and click Create pull request.
What a PR shows
- The list of commits and the combined diff.
- Review comments and approvals.
- The status of automated checks (see GitHub Actions).
Example
git switch -c fix-typo
# ...edit files...
git commit -am "Fix typo in README"
git push -u origin fix-typo
# Optionally open the PR from the terminal with the GitHub CLI
gh pr create --title "Fix typo in README" --body "Small docs fix"When to use it
- A developer opens a pull request after finishing a feature so teammates can review, comment, and approve before the code merges.
- A contributor to an open-source project submits a pull request from their fork to propose a bug fix to the upstream maintainer.
- A team uses draft pull requests to share work-in-progress code early and gather design feedback before it is code-review ready.
More examples
Open a pull request with GitHub CLI
Creates a pull request from the command line, specifying title, body, base branch, and source branch.
gh pr create \
--title "feat: add dark mode toggle" \
--body "Closes #88. Adds a theme switcher component." \
--base main \
--head feature/dark-modeOpen a draft PR for early review
A draft PR signals the work is incomplete; GitHub blocks the merge button until the author marks it ready for review.
gh pr create --draft \
--title "WIP: refactor auth service" \
--body "Not ready for merge. Sharing for early design feedback."Check PR status from the terminal
Shows CI check results and reviewer status for the PR linked to the current branch without opening a browser.
gh pr status
# Current branch
# #42 feat: add dark mode toggle [feature/dark-mode]
# - Checks: 2 passing
# - Review: 1 approved, 1 requested
Discussion