How to Create a pull request in GitHub

Tish Faroul
2 min readOct 31, 2022

--

I recently participated in my first Hacktoberfest!, which gave me the excuse to get into contributing to open-source projects.

If you haven’t already, you should consider contributing to open-source projects as they give you the opportunity to network with other developers and companies and learn from the projects you contribute to.

Here’s how it works —

  1. Fork and clone the repository
  2. Make any changes or additions to the project that you feel can improve.
  3. Submit a pull request to the repository’s owner so they can approve and merge your changes.

Fork and clone the repository

When contributing to another developer’s project, you must first fork and clone it.

  1. Go to the GitHub repo you want to contribute to and hit fork.

This will create a copy of the repo for you.

2. Go to your copy of the repo and clone it by clicking the green code button and copying the URL.

  • To clone the repository using HTTPS, under “HTTPS”.
  • To clone the repository using an SSH key, click SSH.
  • To clone a repository using GitHub CLI, click GitHub CLI

3. Go to your terminal and type in “git clone URL-YOU-COPIED” and hit “enter”

Make changes/additions to the project

Open your new repo and make changes to the project.

Don’t forget to save!

Submit a pull request

  1. Go to the original repo, not yours, and copy the URL listed under the green code button.

2. Go back to your project and create a new branch:

  • In your terminal type in “git checkout -b NAME-OF-YOUR-BRANCH”
  • Test to make sure that you’re in your new branch by typing “git remote -v”

3. Git add your file, Git commit -m “your message”, git push origin NAME-OF-YOUR-BRANCH

4. Go back to your forked repository on GitHub.

5. Click “Compare & Pull Request”

6. Add details to the pull request

Include:

  • The changes you’ve made
  • The issue number you’ve tackled (if you’re solving one of their issues)

✨✨✨And that’s it!

Tish⚡️🎧🌙

--

--