If you ever want to contribute to a project on github the first step is to fork that project. Below are the simplest steps that you can follow to contribute to an open source project.
Go to the repo that you want to work on. Once you are there there, click on the Fork button in the top-right corner. This creates a new copy of that project(say:demoProject) under your GitHub user account with a URL like:
https://github.com/<YourUserName>/demoProject
This copy under your account includes all the code, branches, and commits from the original repo.
Next, clone the repo to your local machine by opening the terminal on your computer and running the command:
git clone https://github.com/<YourUserName>/demoProject
Once the repo is cloned, you need to do two things:
You have to create a new branch by using the command:
git checkout -b new_branch
Create a new remote for the upstream repo with the command:(this is to create a pull request after you made changes to the cloned repo and you want to submit changes for review.)
git remote add upstream https://github.com/<Actual-user>/<Original-repo>
In this case, "upstream repo" refers to the original repo you created your fork from.
Now you can make changes to the code. The following code creates a new branch, makes an arbitrary change, and pushes it to new_branch:
Once you push the changes to your repo, the Compare & pull request button will appear in GitHub.
Click it and you'll be taken to this screen:
GitHub's Open pull request button Open a pull request by clicking the Create pull request button. This allows the repo's maintainers to review your contribution. From here, they can merge it if it is good, or they may ask you to make some changes.
In Short:
If you want to contribute to a project, the simplest way is to:
Find a project you want to contribute to
-> Fork it
-> Clone it to your local system
-> Make a new branch
-> Make your changes
-> Push it back to your repo
-> Click the Compare & pull request button
-> Click Create pull request to open a new pull request
If the reviewers ask for changes, repeat steps 5 and 6 to add more commits to your pull request.