How to make a pull request and contribute to OpenSource?

This is how you can make your first pull request and become a contributor to the OpenSource community on GitHub.

Harsh Prateek
4 min readApr 21, 2022
Photo by Praveen Thirumurugan on Unsplash

There is a lot of respect and admiration for developers who contribute to the OpenSource community. For beginners, it is an opportunity to showcase their talents, get noticed by any potential employee, and also add great projects and experience to their resumes. All these benefits lure many beginners to try out OpenSource projects and contribute to them.

Any OpenSource project has a GitHub repo so anyone willing to contribute can do that by just having a GitHub account and the required knowledge of the tech stack needed to contribute to the codebase. I published an article on medium about how you can make a GitHub account, make a Git repository of your own, and commit your code to your GitHub repository.

In this article, I am going to tell you how can you contribute to the OpenSource community and make a pull request on GitHub. Let’s get started!

Step 1:) Find an OpenSource on GitHub:

In this step, we will find an OpenSource project to work on and contribute to. In case you are not getting a repo for starting to contribute then I will add a link to my own repo which I have made for making this tutorial, you can use that and commit your code there. This is my own repo which you can use. Open GitHub and search for the OpenSource projects from the search area next to the GitHub logo. Type OpenSource in the search area and hit:

The landing page of GitHub
This is the landing page of GitHub if you are logged in

You will see this screen after searching, click on the language you want to contribute into. After selecting the language, select the repo you want to work on and click on it:

The search results of GitHub
This is the page for selecting a language or repo

Click on the fork button, it will clone the entire repo to your GitHub account and then you can make changes to the codebase like it is your own. This is the button which you have to click:

This is the button to fork the repo to your account
The fork button will add the repo to your GitHub account

After doing this, we will get the URL that will add the repo to your GitHub profile. We have added the repo to your GitHub profile and now it is time to work on it on the repo on our system.

Step 2:) Cloning the repo on the system:

In this step, we clone the repo to our system and make some changes to the code. Open the repo in GitHub in your repos and copy the link to the page. It should look something like this

https://github.com/<YourUserName>/<repoName>

Now open the terminal and give the following command with copied link:

git clone https://github.com/<YourUserName>/<repoName>

Step 3:) Pushing the changes to the repo:

After the repo is cloned to your system, you have to do two things:

  1. Create a new branch by pasting this command:
git checkout -b new_branch

Here new_branch is the name of the branch which you can keep anything.

2. Create a remote for the original repo:

git remote add upstream https://github.com/<original_creator>/<repo_Name>

Now you can make changes and push the changes to the repo with this command:

git push -u origin new_branch

This will commit your changes to the repo you have on GitHub. From there you can compare changes and then push the changes to the original repo.

Conclusion:

This was how you are supposed to contribute to open source. It is a good practice to dedicate some amount of time every day to commit to GitHub, as it shows that you are working hard and this will make you more likely to get a job if apply for a company similar to the repos you are working on. I wish you to have a remarkable OpenSource journey as now you know how to work on projects OpenSource.

Follow me on Twitter where I post about what I am working on, and on Medium where I write posts about coding and Web development. Have a great day.

--

--

Harsh Prateek

Hi, I am Harsh and I write about coding and learning techniques. I am a student myself and would love to tell everyone my secrets for coding and learning.