GitHub Pull Request

In this short How-To article, we will fork a public GitHub repository, modify its code, and create a pull request for our changes.

This procedure includes the following steps:

  1. Fork the Repository
  2. Modify your Repository Fork
  3. Create a Pull Request.

Fork the Repository

Fork Option/Button for Public GitHub Repository.

Choose name for your personal fork of this repository and confirm fork creation.

Repository Fork on Personal GitHub Account.

Clone your repository fork to your local device:

git clone git@github.com:<username>/<repository_fork_name>.git

Modify your Personal Fork / Create Changes

Create and Checkout Branch:

git branch <branch_name>
git checkout <branch_name>

Modify the Code.

Add and Commit Changes:

git add <changed_files_to_add>
# double-check the added files using `git status`
git commit
# write meaningful commit message

Push the Commit(s) to your personal repository for on GitHub:

git push --set-upstream origin <branch_name>

Open Pull Request

Navigate to the respective branch on GitHub, click on 'Contribute', and open the pull request.
Double check which branch and repository should be merged to which other branch repository.
Double check the changes included in this pull request.
Write a concise title and description, and create the pull request.

Then, wait for review, revise the code accordingly, and push the changes to the same branch (should update the pull request automatically).

Once every issue has been addressed, the pull request will be merged -> CONGRATULATIONS, you are now a contributor.




Enjoy Reading This Article?

Here are some more articles you might like to read next:

  • Gradient Evolution
  • Zsh and Oh-My-Zsh Installation Guide
  • Data Spaces
  • Python Virtual Environment
  • GitHub SSH Key