Build what's next on GitHub, the place for anyone from anywhere to build anything.
Join us October 28-29 in San Francisco or online for GitHub Universe, our flagship developer event uniting people, agents, and the world's code.
As part of the GitHub for Beginners guide, learn how to create pull requests. This will enable you to suggest changes to existing repositories.

Welcome back to GitHub for Beginners, a series designed to help you navigate GitHub with ease.
So far in this series, we’ve covered the top Git commands every developer should know, how to create repositories, how to upload files and folders to your repository, and how to add code to your repository. In our most recent entry, we talked briefly about pull requests, but now we’re going to dive into them at depth. This entry is dedicated to showing you how to create a pull request so you can suggest changes to a repository and have others review those changes before committing them.
Let’s get started!
A pull request (often referred to as “PR”) is a proposal to merge a set of changes from one branch into another. By creating a pull request, you can review a set of changes with others before they are incorporated into the main code base. Before getting to that, it’s helpful to define a couple of terms.
Pull requests provide a visual representation of the differences in the content between the source branch and the target branch. This is what enables you to review the changes before accepting them and pulling them into the target branch.
You can create a pull request on GitHub.com with GitHub Desktop, GitHub Codespaces, on GitHub Mobile, and when using the GitHub CLI. You can also create a pull request from the terminal using git, which is what we’ll do here.
On GitHub, navigate to your repository, clone it, and create a new branch. If you need a refresher for any of these steps, refer to the earlier GitHub for Beginners entries. For the purposes of this walkthrough, we created a new branch in our repository called update-name. After creating this branch, open your terminal and run git checkout -b update-name to navigate to the update-name branch.

Open a file in the repository in your editor, and make a change. In our case, we made a change to the index.html file. Don’t forget to save the file!
Stage and then commit your changes by running the following commands in the terminal:
Once these commands are complete, run git status to ensure that the changes were successfully committed. If they were, you should see a message indicating that there is nothing to commit and your working tree is clean. Awesome!
Now you will need to push your changes to the repository on GitHub. You do this by running git push origin update-name in the terminal. Remember that if you used a different name for your branch, you will need to replace update-name with the name of your branch: git push origin your-branch-name.
https://github.blog/wp-content/uploads/2024/08/2-push-code.mp4#t=0.001
Navigate to GitHub, and you should see a message indicating that your branch had recent pushes a short while ago. Click the green button that says “Compare & pull request.” This will take you to the pull request page, where you can enter the information for your pull request.

In the top left of the page is a dropdown button that says “base:” followed by a branch name. Most likely, this will say “base: main.” This indicates the branch that you want to merge the changes into, otherwise known as the target branch. Click the button and select “main” if it isn’t already selected.
The dropdown box to the immediate right of the “base:” box is the “compare:” box. This indicates the branch that you are merging from, otherwise known as the source branch. Click this box and select the branch where you made your changes.
https://github.blog/wp-content/uploads/2024/08/4-openpr-branches.mp4#t=0.001
After making sure the target and source branches are set correctly, add a title and a description for the pull request. The description should explain the changes that you made. If you are not ready for your changes to be reviewed, you can create a draft pull request. Or you can create a pull request for review by pressing the green “Create pull request” button. Do that now.

Congratulations! You’ve created your pull request! Now, you can have someone else on the team review your changes. Once they have provided a review, you can merge your changes into the target branch by clicking the green “Merge pull request” button at the bottom of the page.

When you create pull requests going forward, here are a few best practices you should keep in mind.
Now that you can create pull requests, you can use this repository to practice creating them. Once you feel comfortable creating pull requests, you have the power to suggest changes to existing repositories and offer your own contributions for consideration. It’s an excellent way to collaborate, so give it a shot!
If you have any questions, pop them in the GitHub Community thread and we’ll be sure to respond.
Here are some more resources to help you on your GitHub journey: