Practice Submitting Pull Requests
A pull request from a branch allows collaborators to suggest changes to a repository on GitHub that can be easily reviewed by others in the project. Learn how to create branches and submit pull requests on GitHub.com to suggest changes to a GitHub repository.
- Define branches in GitHub repositories
- Submit a pull request of changes to a repository on
GitHub.com
.
In this lesson, you will learn how to submit a pull request to suggest changes to a repository you are collaborating on.
You will need a web browser and your GitHub.com
login (username and password).
For this assignment, you will add information about your GitHub username and, optionally, your personal website to a repository.
Step 2: Make your changes
- Click on the
README.md
file.
Then, click on the edit button in the upper right.
Add a row to the directory table with any of the following information you are comfortable sharing:
- Your name, linked to a pronounciation link. We recommend that everyone use these even if your name is “easy to pronounce” because pronounciation difficulty always depends on the language of the speaker.
- Your GitHub username, linked to your GitHub profile page
https://github.com/<your-username>
- Your personal website or a social media profile, linked to itself.
- Your LinkedIn profile, linked to itself (optional)
At the end it should look like:
Select the
Commit
button.Make sure to select
Make changes in another branch
. This will create a branch with your changes in it! You can name the branch anything you want other thanmain
, but the default (<your-username>-patch-1
) is fine.Write a message, including your username, so that the adminstrators can identify what the pull request is doing easily. You can add additional details in the description if you like, but the message is the most important part since that is what will be visible in the list of Pull Requests.
Click the
Propose changes
button.
Pull Requests allow you to suggest changes without changing the “default” version of a repository (typically the main
branch)
A pull request:
- Allows others to review your changes and suggest corrections, additions, edits, etc.
- Allows repository administrators control over what gets added to their project repo.
The ability to suggest changes is a powerful feature of GitHub
. You can make as many changes as you want, and then suggest that the project manager or owner incorporate those changes using a pull request. When you make additional changes in your branch, they will get added to your pull request automatically until it is merged in. Then you will need a new branch and a new pull request.