Skip to main content

Pull Requests

Pull requests let you tell others about changes you've pushed to a branch in a repository on GitHub. Once a pull request is opened, you can discuss and review the potential changes with collaborators and add follow-up commits before your changes are merged into the base branch.

Pull Request

Key Features

  • Creating a Pull Request: Step-by-step process on how to propose changes to a repository. You can create a PR from a fork or a branch within the same repository.
  • Collaborating with Pull Requests: Information on how to discuss, review, and manage changes. You can request reviews from specific team members or teams.
  • Draft Pull Requests: How to share work-in-progress without triggering formal reviews or automated CI jobs that only run on ready-for-review PRs.
  • Reviewing Changes: Using the "Files changed," "Commits," and "Conversation" tabs to track progress and maintain code quality. Reviewers can leave line-by-line comments, approve the PR, or request changes.
  • Checking Out Locally: How to modify an active pull request on your local machine using the GitHub CLI or Git.

Approving and Merging

Once a pull request has been reviewed and approved, it can be merged into the base branch. GitHub offers several merging strategies:

  • Merge commit: Creates a merge commit, preserving the entire history of the feature branch.
  • Squash and merge: Combines all commits from the feature branch into a single commit on the base branch.
  • Rebase and merge: Reapplies the commits from the feature branch onto the base branch without creating a merge commit.