GitHub Pull Requests: How and Why to Use Pull Requests

Become a PR pro in about 5 minutes.
JohnJohn John (304)
Nov 19, 2020
5 minutes

At howchoo, our code is on private Github repos. We’ve recently started using pull requests to submit new changes to the code base. Likewise, we’ve been using Github issues for a while to keep track of bug fixes and small tasks. Our workflow has been improved significantly due to a few hidden gems in Github. In this guide, I’ll show how to make pull requests as well as a few other workflow tips.

Posted in these interests:
h/webdev • 60 guides
h/code • 69 guides
GitHubGitHub
h/github • 8 guides
Finding the pull requestsFinding the pull requests

When viewing a repository in your Github account, you should see an icon with the words “Pull requests”. Fitting, right? Click on that link to go to the pull request page.

Click "New pull request"Click "New pull request"

The pull requests page will show you existing, open pull requests. You’ll find a button at the top that says “New pull request”. Click that one.

Choose your branchesChoose your branches

At this point you’ll choose your branches, on the left the branch you’re merging into and on the right the branch you’re merging from. At this point, it’s assumed that you’ve pushed your branch to origin. The branch you’re merging into is often master or depending on your branching model it could be called develop. When this pull request is closed, the compare branch will be merged into the base branch.

Create the pull requestCreate the pull request

Once you’ve selected your branches, click “Create pull request”. This won’t create it but will give you the chance to leave a comment. It’s a good idea to leave a descriptive comment about what changes will be merged. It is assumed that another developer will be reviewing these changes so comments are helpful. At this point, you can scroll down to see a diff of the files changed. This is a good time to do a final review of your code to make sure it’s ready to be merged. Now click “Create pull request” again to actually create the request.

Pull requests are a great way to review code. Once you’ve created the pull request you can send the url to someone else in the organization. They will be able to see the diff, leave comments, and eventually close and merge the pull request if everything looks good.

Wouldn’t it be cool if Github would automatically close issues with a pull request? Well, they do! Before submitting the pull request, you should use the following language in a commit message:

Fixes #167
where 167 is the issue number this branch should close. By typing this in the commit message, issue number 167 will automatically be closed when the branch is merged into master. There are a number of different phrases you can write in the commit message to force the issue to be closed. A full list can be found here – Closing issues via commit messages.
GitHub Codespaces is officially in beta.
AshAsh Ash (362)
Feb 4, 2021
0

Earlier this week, GitHub announced the launch of a new cloud-hosted IDE known as GitHub Codespaces. This new service is a full development environment based on Microsoft’s Visual Studio Code.

GitHub Pull Requests: How and Why to Use Pull Requests

Become a PR pro in about 5 minutes.
JohnJohn John (304)
Nov 19, 2020
5 minutes

At howchoo, our code is on private Github repos. We’ve recently started using pull requests to submit new changes to the code base. Likewise, we’ve been using Github issues for a while to keep track of bug fixes and small tasks. Our workflow has been improved significantly due to a few hidden gems in Github. In this guide, I’ll show how to make pull requests as well as a few other workflow tips.

Posted in these interests:
h/webdev • 60 guides
h/code • 69 guides
GitHubGitHub
h/github • 8 guides
Finding the pull requestsFinding the pull requests

When viewing a repository in your Github account, you should see an icon with the words “Pull requests”. Fitting, right? Click on that link to go to the pull request page.

Click "New pull request"Click "New pull request"

The pull requests page will show you existing, open pull requests. You’ll find a button at the top that says “New pull request”. Click that one.

Choose your branchesChoose your branches

At this point you’ll choose your branches, on the left the branch you’re merging into and on the right the branch you’re merging from. At this point, it’s assumed that you’ve pushed your branch to origin. The branch you’re merging into is often master or depending on your branching model it could be called develop. When this pull request is closed, the compare branch will be merged into the base branch.

Create the pull requestCreate the pull request

Once you’ve selected your branches, click “Create pull request”. This won’t create it but will give you the chance to leave a comment. It’s a good idea to leave a descriptive comment about what changes will be merged. It is assumed that another developer will be reviewing these changes so comments are helpful. At this point, you can scroll down to see a diff of the files changed. This is a good time to do a final review of your code to make sure it’s ready to be merged. Now click “Create pull request” again to actually create the request.

Pull requests are a great way to review code. Once you’ve created the pull request you can send the url to someone else in the organization. They will be able to see the diff, leave comments, and eventually close and merge the pull request if everything looks good.

Wouldn’t it be cool if Github would automatically close issues with a pull request? Well, they do! Before submitting the pull request, you should use the following language in a commit message:

Fixes #167
where 167 is the issue number this branch should close. By typing this in the commit message, issue number 167 will automatically be closed when the branch is merged into master. There are a number of different phrases you can write in the commit message to force the issue to be closed. A full list can be found here – Closing issues via commit messages.
GitHub Codespaces is officially in beta.
AshAsh Ash (362)
Feb 4, 2021
0

Earlier this week, GitHub announced the launch of a new cloud-hosted IDE known as GitHub Codespaces. This new service is a full development environment based on Microsoft’s Visual Studio Code.

 
1

GitHub Pull Requests: How and Why to Use Pull Requests

Become a PR pro in about 5 minutes.
JohnJohn John (304)
Nov 19, 2020
5 minutes

At howchoo, our code is on private Github repos. We’ve recently started using pull requests to submit new changes to the code base. Likewise, we’ve been using Github issues for a while to keep track of bug fixes and small tasks. Our workflow has been improved significantly due to a few hidden gems in Github. In this guide, I’ll show how to make pull requests as well as a few other workflow tips.

Posted in these interests:
h/webdev • 60 guides
h/code • 69 guides
GitHubGitHub
h/github • 8 guides
Finding the pull requestsFinding the pull requests

When viewing a repository in your Github account, you should see an icon with the words “Pull requests”. Fitting, right? Click on that link to go to the pull request page.

Click "New pull request"Click "New pull request"

The pull requests page will show you existing, open pull requests. You’ll find a button at the top that says “New pull request”. Click that one.

Choose your branchesChoose your branches

At this point you’ll choose your branches, on the left the branch you’re merging into and on the right the branch you’re merging from. At this point, it’s assumed that you’ve pushed your branch to origin. The branch you’re merging into is often master or depending on your branching model it could be called develop. When this pull request is closed, the compare branch will be merged into the base branch.

Create the pull requestCreate the pull request

Once you’ve selected your branches, click “Create pull request”. This won’t create it but will give you the chance to leave a comment. It’s a good idea to leave a descriptive comment about what changes will be merged. It is assumed that another developer will be reviewing these changes so comments are helpful. At this point, you can scroll down to see a diff of the files changed. This is a good time to do a final review of your code to make sure it’s ready to be merged. Now click “Create pull request” again to actually create the request.

Pull requests are a great way to review code. Once you’ve created the pull request you can send the url to someone else in the organization. They will be able to see the diff, leave comments, and eventually close and merge the pull request if everything looks good.

Wouldn’t it be cool if Github would automatically close issues with a pull request? Well, they do! Before submitting the pull request, you should use the following language in a commit message:

Fixes #167
where 167 is the issue number this branch should close. By typing this in the commit message, issue number 167 will automatically be closed when the branch is merged into master. There are a number of different phrases you can write in the commit message to force the issue to be closed. A full list can be found here – Closing issues via commit messages.
GitHub Codespaces is officially in beta.
AshAsh Ash (362)
Feb 4, 2021
0

Earlier this week, GitHub announced the launch of a new cloud-hosted IDE known as GitHub Codespaces. This new service is a full development environment based on Microsoft’s Visual Studio Code.

GitHub Pull Requests: How and Why to Use Pull Requests

Become a PR pro in about 5 minutes.
JohnJohn John (304)
Nov 19, 2020
5 minutes

At howchoo, our code is on private Github repos. We’ve recently started using pull requests to submit new changes to the code base. Likewise, we’ve been using Github issues for a while to keep track of bug fixes and small tasks. Our workflow has been improved significantly due to a few hidden gems in Github. In this guide, I’ll show how to make pull requests as well as a few other workflow tips.

Posted in these interests:
h/webdev • 60 guides
h/code • 69 guides
GitHubGitHub
h/github • 8 guides

GitHub Pull Requests: How and Why to Use Pull Requests

Become a PR pro in about 5 minutes.
JohnJohn John (304)
Nov 19, 2020
5 minutes
John
 
1
Posted in these interests:
h/webdev • 60 guides
h/code • 69 guides
GitHubGitHub
h/github • 8 guides
Posted in these interests:
h/webdev • 60 guides
h/code • 69 guides
GitHubGitHub
h/github • 8 guides
GitHub
Table of Contents

GitHub Pull Requests:

  1. Finding the pull requests
  2. Click “New pull request”
  3. Choose your branches
  4. Create the pull request
  5. Code review
  6. Automatically close Github issues with a pull request
 
1
In these interests
h/webdev • 60 guides
h/code • 69 guides
GitHubGitHub
h/github • 8 guides
h/webdev • 60 guides
h/code • 69 guides
GitHubGitHub
h/github • 8 guides
GitHub
Finding the pull requestsFinding the pull requests

When viewing a repository in your Github account, you should see an icon with the words “Pull requests”. Fitting, right? Click on that link to go to the pull request page.

Finding the pull requestsFinding the pull requests

When viewing a repository in your Github account, you should see an icon with the words “Pull requests”. Fitting, right? Click on that link to go to the pull request page.

Finding the pull requests

Finding the pull requests
Click "New pull request"Click "New pull request"

The pull requests page will show you existing, open pull requests. You’ll find a button at the top that says “New pull request”. Click that one.

Click "New pull request"Click "New pull request"

The pull requests page will show you existing, open pull requests. You’ll find a button at the top that says “New pull request”. Click that one.

Click “New pull request”

Click "New pull request"
Choose your branchesChoose your branches

At this point you’ll choose your branches, on the left the branch you’re merging into and on the right the branch you’re merging from. At this point, it’s assumed that you’ve pushed your branch to origin. The branch you’re merging into is often master or depending on your branching model it could be called develop. When this pull request is closed, the compare branch will be merged into the base branch.

Choose your branchesChoose your branches

At this point you’ll choose your branches, on the left the branch you’re merging into and on the right the branch you’re merging from. At this point, it’s assumed that you’ve pushed your branch to origin. The branch you’re merging into is often master or depending on your branching model it could be called develop. When this pull request is closed, the compare branch will be merged into the base branch.

Choose your branches

Choose your branches
Create the pull requestCreate the pull request

Once you’ve selected your branches, click “Create pull request”. This won’t create it but will give you the chance to leave a comment. It’s a good idea to leave a descriptive comment about what changes will be merged. It is assumed that another developer will be reviewing these changes so comments are helpful. At this point, you can scroll down to see a diff of the files changed. This is a good time to do a final review of your code to make sure it’s ready to be merged. Now click “Create pull request” again to actually create the request.

Create the pull requestCreate the pull request

Once you’ve selected your branches, click “Create pull request”. This won’t create it but will give you the chance to leave a comment. It’s a good idea to leave a descriptive comment about what changes will be merged. It is assumed that another developer will be reviewing these changes so comments are helpful. At this point, you can scroll down to see a diff of the files changed. This is a good time to do a final review of your code to make sure it’s ready to be merged. Now click “Create pull request” again to actually create the request.

Create the pull request

Create the pull request

Pull requests are a great way to review code. Once you’ve created the pull request you can send the url to someone else in the organization. They will be able to see the diff, leave comments, and eventually close and merge the pull request if everything looks good.

Pull requests are a great way to review code. Once you’ve created the pull request you can send the url to someone else in the organization. They will be able to see the diff, leave comments, and eventually close and merge the pull request if everything looks good.

Code review

Wouldn’t it be cool if Github would automatically close issues with a pull request? Well, they do! Before submitting the pull request, you should use the following language in a commit message:

Fixes #167
where 167 is the issue number this branch should close. By typing this in the commit message, issue number 167 will automatically be closed when the branch is merged into master. There are a number of different phrases you can write in the commit message to force the issue to be closed. A full list can be found here – Closing issues via commit messages.

Wouldn’t it be cool if Github would automatically close issues with a pull request? Well, they do! Before submitting the pull request, you should use the following language in a commit message:

Fixes #167
where 167 is the issue number this branch should close. By typing this in the commit message, issue number 167 will automatically be closed when the branch is merged into master. There are a number of different phrases you can write in the commit message to force the issue to be closed. A full list can be found here – Closing issues via commit messages.

Automatically close Github issues with a pull request

GitHub Codespaces is officially in beta.
AshAsh Ash (362)
Feb 4, 2021
0

Earlier this week, GitHub announced the launch of a new cloud-hosted IDE known as GitHub Codespaces. This new service is a full development environment based on Microsoft’s Visual Studio Code.

GitHub Codespaces is officially in beta.
AshAsh Ash (362)
Feb 4, 2021
0

Earlier this week, GitHub announced the launch of a new cloud-hosted IDE known as GitHub Codespaces. This new service is a full development environment based on Microsoft’s Visual Studio Code.

NEXT UP
GitHub Announces Cloud-Based IDE: GitHub Codespaces
GitHub Codespaces
GitHub Codespaces is officially in beta.
AshAsh Ash (362)
Feb 4, 2021
0
Ash Continue reading
Share this guide!
RedditEmailText
John's profile pictureJohn's profile pictureJohn
Joined in 2015 304 guides
Software Engineer and creator of howchoo.
John's profile picture
Related to this guide:
GitHub CodespacesGitHub Codespaces
GitHub Codespaces is officially in beta.
In these interests: newsgithub
Intro to Hub: Improve Your GitHub Workflow with the CLI ToolIntro to Hub: Improve Your GitHub Workflow with the CLI Tool
Hub overview Hub is a command-line tool that wraps git and provides extra functionality that makes working with GitHub easier.
In these interests: gitgithub
github package registrygithub package registry
Publishing software packages is already pretty easy, so what does GitHub’s Package Registry offer that we don’t already have?
In these interests: newsgithubgit
GitHub CodespacesGitHub Codespaces
GitHub Codespaces is officially in beta.
In these interests: newsgithub
Ash's profile pictureView guide
In these interests: newsgithub
newsgithub
Intro to Hub: Improve Your GitHub Workflow with the CLI ToolIntro to Hub: Improve Your GitHub Workflow with the CLI Tool
Hub overview Hub is a command-line tool that wraps git and provides extra functionality that makes working with GitHub easier.
In these interests: gitgithub
John's profile pictureView guide
In these interests: gitgithub
gitgithub
github package registrygithub package registry
Publishing software packages is already pretty easy, so what does GitHub’s Package Registry offer that we don’t already have?
In these interests: newsgithubgit
John's profile pictureView guide
In these interests: newsgithubgit
newsgithubgit
People also read:
A screenshot of VSCode ExtensionsA screenshot of VSCode Extensions
A screenshot of VSCode ExtensionsHow to Sync VS Code Settings Across Your Machines
Docker secretsDocker secrets
Docker secretsGetting Started with Docker Secrets
Google WorkspaceGoogle Workspace
Google Workspace10 Reasons to Upgrade to Google Workspace (G Suite)
Raspberry Pi commandsRaspberry Pi commands
Raspberry Pi commandsThe Most Common Raspberry Pi Commands (And What They Do)
How to Blog in Markdown Using GitHub and Jekyll Now
1Password vs NordPass1Password vs NordPass
We put the two password managers side by side for you!
Move in BlenderMove in Blender
Stuck in Blender? Let’s get things moving!
1Password vs NordPass1Password vs NordPass
1Password vs NordPass1Password vs NordPass: Who Wins Might Surprise You!
Upgrading macOS: Fix Invalid Active Developer Path
Move in BlenderMove in Blender
Move in BlenderHow to Move in Blender
Windows 10 IP addressWindows 10 IP address
Windows 10 IP addressHow to Find Your IP Address on Windows 10
3D printer filament3D printer filament
3D printer filament3D Printing Materials and Filament—A Comprehensive Guide
Posted in these interests:
webdevwebdev
Explore
h/webdev • 60 guides
All things web development.
codecode
Explore
h/code • 69 guides
Code is poetry — one line at a time.
GitHubGitHub
Explore
h/github • 8 guides
webdevwebdev
Explore
h/webdev • 60 guides
All things web development.
Explore
codecode
Explore
h/code • 69 guides
Code is poetry — one line at a time.
Explore
GitHubGitHub
Explore
h/github • 8 guides
Explore
Discuss this guide!
Discover interesting things!
Explore Howchoo’s most popular interests.
Explore

Follow @howchoo and learn cool things:

Are you a passionate writer? We’re hiring!

Write for Howchoo

Like what we do?

Donate

Want to support Howchoo? When you buy a tool or material through one of our Amazon links, we earn a small commission as an Amazon Associate.

Write for HowchooDonate

Leave a Reply

Your email address will not be published. Required fields are marked *