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.
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:
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:
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:
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
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:
- 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.
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.