A Step-By-Step Guide to Contributing on GitHub : 3 easy steps

GitHub is open source, which means anyone can modify or download any project on GitHub. When you modify someone else’s work, it’s referred to as contributing.

Follow these easy steps to contribute to a project.

Firstly, one thing you need to keep in mind is that you should not make any changes differently on the other user’s project. You need to make a copy of it, make changes to them and then request the other user to merge your changes.

You probably won’t have the permission to directly work on someone else’s repo either.

Secondly, I have not elaborated Step 2 here on this blog because I have already done it in a previous blog:

  1. Using GitHub Desktop :
    • If you are completely new to GitHub, then you can check this out to get the visual idea of what the terms mean before using the command line.
  2. Using git commands :
    • You will find all the commands here.

Step 1: Go to the repo and Fork

First things first! Fork the other user’s repo. Fork means to copy. When you fork a repo, you are basically copying the whole thing to your GitHub where you can freely make changes and the original repo will not be altered.

To Fork(copy) a repo you need to :

  1. Go to the repo you want to contribute to
  2. Click Fork on the top right corner
  3. The repo will be forked to your GitHub

I am signed in as “SkAdilina” here and I am going to contribute to the “Hello_World” repo of user “TheMainUser”

1_another_user

Step 2: Clone, Edit, Commit and Push

Notice that the repo “Hello World” is in my (SkAdilina) GitHub now and the original location “TheMainUser/Hello_World” is mentioned right below.

You will clone the repo that is in your GitHub not the original one.
I will have to clone “SkAdilina/Hello_World” NOT “TheMainUser/Hello_World”

After you have pushed the changes to your GitHub. Note that the changes have been made on the forked repo on your GitHub.

6_updated_only_in_your_github

Step 3: Pull Request

So now you need to request the owner of the original repo to merge your changes with the original project.
In order to do that you will have to send a “Pull Request”.

  1. Go to the “Pull Request” tab
  2. Click “New pull request
  3. You will be taken to a page where you will be able to compare changes. Click “Create pull request” if you are happy with the changes.
  4. Add add  a name of the Pull Request and may be add a description as well to explain your request.
  5. Finally click “Create pull request” to send the request.

Woo-hoo! Congratulations!

You are on your way to making your first contribution.

Now wait for the owner of the repository to accept your request and merge the changes. That person might even want you to make further changes before merging. So, GOOD LUCK !

Update a Fork

If you want to make further contribution to the same repo in the future, you will have to update the forked repo that is in your GitHub. You need to do this to sync with the original repo as many people might be making changes to the repo, you should work on the most updated version.
Unfortunately, you cannot update a Fork using the GitHub desktop, you need the terminal for this.

(This is where you will find the commands.)

2 thoughts on “A Step-By-Step Guide to Contributing on GitHub : 3 easy steps

Leave a comment