When you think of GitHub, the words that are most likely to pop up in your head are collaborative coding.

In the eyes of its founder, GitHub was created to help developer teams to collaborate with each other on the same piece of code without stepping on each other’s toes.

And an integral aspect of this collaboration with fellow developers is to have the ability to suggest changes to the code.

These changes get reviewed by a teammate. And then, they are pulled and merged into the corresponding branch by the reviewer.

By suggesting changes rather than allowing them to be made directly, chaos is avoided. Because when two or more developers are collaborating on a piece of code, unless each one knows the logic behind it, making direct changes can have grave consequences.  

Having had a quick understanding of the ‘what’ and the ‘why’ of creating pull requests, let's get to the 'how' part, shall we?


Before You Begin

There are two things you need to check for before you create a pull request.

  1. Selecting the destination repository and branch
  2. Permissions

Selecting the destination repository and branch

You must be familiar with repositories and branches in GitHub by now.

And so, you would know that the best practice while working on your code is to create separate branches and make changes to them before pushing them into the *master* branch. This way, only the final version of the code gets pushed into the master branch.

Since by default the pull requests are created based on the repository’s default branch, select the appropriate destination repository and *base branch* before suggesting changes.

The base branch is the branch you want the changes you suggested to be reflected on. You must also select the compare branch, the branch you make your suggestions in.

Use the drop-down to switch to the right repository and corresponding branches.

Permissions

You require read permissions to a repository to create a pull request while write permissions are needed to create a branch.

Depending on the permissions you hold to the destination repository, here’s how you can go about it:

  1. Creating a pull request
  2. Creating a pull request from a fork

How to Create a Pull Request in GitHub

Once all the prerequisites are set, you can jump straight to creating your first pull request using the following steps:

1. Open the main page of your repository on your GitHub account in your browser and click on the Pull requests tab.

Pull requests tab in GitHub
Click on the Pull requests tab within the desired repo to suggest code changes

But if you’re using the desktop app, go to Branch -> Create pull request and follow the steps mentioned below.

Create pull request in GitHub desktop
Click on Create a request to be redirected to the Pull requests page in the browser

Note: Regardless of whether you use the desktop app or the browser, the ‘Create pull request’ page will open in your browser only.  

2. Now, click on the New pull request button.

3. Choose the appropriate base branch and the compare branch and click on Create pull request.

Create pull request button in GitHub
Select the relevant branches using their drop-down menus and click on Create pull request 

4. Enter a suitable title and description for the pull request.

Note: the title is usually auto-filled with the branch's name and the description has the list of all commits that were performed in that branch.

And with that, you would have successfully created your first pull request to be reviewed by your teammates.  


How to Create a Pull Request from a Fork in GitHub

Forking in GitHub is a handy feature when you don’t have the necessary permissions to access the repository in which you wish to suggest changes and you don’t want to waste your valuable time waiting for it.

Once you’ve made changes to your forked repository, you can suggest to push them into the original repository using the following steps:

1. Open the main page of the original repository that you created a fork for.

2. Navigate to the Pull requests tab above the files displayed.

3. Now, click on compare across forks on the page that appears.

Create a pull request from a forked repo in GitHub
Click on compare across forks to create a pull request for a forked repo

4. Using the respective drop-down menus, select the *base repository* and *base branch* to select the destination repo and branch you want the changes to be merged to.

5. Also, select the forked repo using the *head repository* drop-down menu and the correct branch with the suggested changes using the *compare branch* drop-down.

Choose a forked repo in GitHub
Choose the relevant repositories and branches using their drop-down menus

6. Click on `Create pull request` and give your pull request an apt title and description.

Now, your changes are ready to be reviewed and approved by your colleagues.


GitHub is every developer’s right hand and we understand that better than anybody else. That’s why we’ve deeply integrated GitHub with Zepel.

Now you can concentrate on doing what you love - building quality software while we take care of the humdrum routine work of updating your progress for you.

All you’ve got to do is use Zepel’s suggested branch name when you create a new branch.

Linking Zepel to GitHub branch
Use Zepel's suggested branch name while creating a new branch

Going one step further, you can link your Slack to Zepel and get real-time notifications of your team’s progress updates.

Zepel integration with GitHub and Slack
Get notified of your team's status updates by setting up this Zepel + GitHub + Slack workflow 

Try Zepel for free and leave it to us to keep your team in the loop regarding your progress updates. Check out why 4000+ teams prefer it over others.

If you're not fully convinced, see how Zepel compares to other agile project management tools.


Helpful Git Articles

Improved development workflow to build software products
A good development workflow is essential for teams to be agile and ship quality features faster. This guide walks through how to set up your workflow.
5 Git Workflows you can use to deliver better code
The right git workflow can help you improve your development process. Here are 5 types of Git Workflows you can use within your team.
Working with Branches: How to Create a Branch in GitHub?
Step-by-step guide on how to create a new branch in GitHub using their website, desktop app, and terminal commands.
Git Commit: How to Commit Code Changes to GitHub?
Imagine your hours’ worth of code disappearing in seconds. 😱 Stop this nightmare from becoming reality, commit your code to GitHub. Here’s how you can do it.