How to contribute to a GitHub project

Fork the project

Clone the forked project
$ git clone

Add the URL of the original project to your local repository so that you will be able to pull changes from it:

$ git remote add upstream
upstream is a convention for GitHub projects.

Check the remote repositories:

$ git remote -v
origin (fetch)
origin (push)
upstream (fetch)
upstream (push)

Create a branch

$ git checkout -b BRANCH_NAME

$ git branch

Work on your contribution

See the source image

While you are working on a project alongside other contributors, it is important for you to keep your local repository up-to-date with the project as you don’t want to make a pull request for code that will cause conflicts. To keep your local copy of the code base updated, you’ll need to sync changes.

Sync the Fork

git fetch upstream
git checkout master
git merge upstream/master

Create a pull request

$ git push origin BRANCH_NAME
Go back to your forked project on GitHub in your browser and you will find a new button at the top of the page to create a pull request.
See the source image