How to Contribute to an Open Source Project

How to Contribute to an Open Source Project

We will look on how to correctly contribute an open source project available in Github.

Overview

It is now a common practice that everyone from zero day or no experience person to 20 years experienced persons who are in industry uses a version controlling system such as Git. When controlling version control systems Github takes a major place among others. So anyway today's topic is not teaching about Github! Today we are going to talk about how to contribute and work on an open source project on Github.

For an demonstration example I have created a brand new Github Account and it now looks like this.

Brand New Github Account

So as you can see there is nothing except empty windows and tabs. So we're gonna to make it busier!

So as the example to teach you about todays topic, today I am going to use https://github.com/CoDeKu-Labs/ as the resource.

Get into the business

  • Step 01

First we need to find out a platform or an organization to contribute. In this case I'm using CoDeKu-Labs Organization. Now you need to follow https://github.com/CoDeKu-Labs/ link first.

Now you will be able to see a page similar to the above image. Now you can click the follow button and save that organization in your list. It make you easier to access that organization later without finding for links everywhere

Follow organization

  • Step 02

Then you can go to the relevant repository. You can find repositories by clicking the 2nd Item (Repositories) on the tab bar.

Then you will be able to see the all repos available. In this case we need to use codeku-devops-cloud-micro-tasks

  • Step 03

After selecting the repo, you will be able to see a page like below. There you will can see all the project and its folder structure. Below that you can find the official documentation and readme of the project. So it is a best practice to read it from very begin to the end to get a clear overview of the project and how it is going forward.

The target repository

  • Step 04

Now you need to select a project to work on! OR see the available projects at this moment. So, to do that, you need to click on Projects. Then you will be able to see a page like this and select the DevOps & Cloud Micro Tasks project there.

Selecting project

  • Step 05

Then you will be able to see a list of available tasks there as follows. Browse them, surf them and find the most suitable one or suitable many tasks for you. Then you need to keep a note on that task code that have mentioned.

Available Tasks

In this case there is a one task available. In that row you can find more useful data relevant to that task such as Task Code, Task, Assignees (you not need to think about this), Status, Labels and The payment amount. If you want to clearly see the available projects, you can click on the Board view.

Board View

Then you'll able to see how the tasks are done or not.

So, when you have completed these steps, you have the desired tasks codes with you. So lets see what are the next steps to follow.

  • Step 06

So, actually the real game is starting from here! You need to come back to the repository. Then what you have to do is first is fork the repository.

Forking the repo- 1

As you can see in the image above, you can fork the repo. Before that make sure to give a star to that repository, so that it can make the repository more popular one. So then click on fork button. Fork means that you will create a copy of that repository in to your own github account. So there you can do changes to the project to whatever desire you want to do so.

Fork 2

Then a page like above will be displayed and you need to do nothing except pressing Create fork button below. You have now completed a significant amount of process up-to this point. So let's dive into the rest of the parts also.

  • Step 07

Now you have a forked copy of the original repository in your personal github profile. Now you have to do is working on it.

From now onwards the procedure is normal github procedure which you have been familiar before too.

1.First you need to clone that repo into your local machine.

Go to your desired work directory and open cmd or whatever terminal you have and execute the following command.

git clone https://github.com/{YOUR GITHUB USERNAME}/codeku-devops-cloud-micro-tasks        

Then you will have a local copy of the project in that work directory as follows.

Terminal and Project that Created.

2.Start your work - Start Coding!

Open the project from your favorite code editor! I'll use VSCode today. Then you have to make a work directory specified to you. So, please do this step correctly and without any mistakes by carefully reading this documentation.

  1. You need to first select the task category (Docker and Containerization / Kubernetes/ Cloud).
  2. Then choose the correct task folder such as CPT-DC-001 . If there is NOT a folder on that project, that means you are the first one who is going to work on that task. Congrats! So create a folder with Task name like CPT-DC-001
  3. Then now you have to make your folder inside that task folder. So you have to simply make a folder by renaming it as follows.

[TASK CODE]_[YOUR GITHUB USERNAME]

ex:- CPT-DC-001_TharinduCoDeKu

4. There can be other users folders also so don't make any change to those! You have only rights to work on your own folder only.

5. So now you can do your development or task related thing there and add all files there accordingly.

Folder structure

3.Push Code to Github

Now you have worked on this project or task and you can check it locally by running unit tests or whatever suitable. Finally after all the stuff, you have to push this code to github.

You can push this code by using the Graphical user Interface or CMD as following.

git add  .
git commit -m "{Commit Message}"
git push        

You can see now the local project is pushed in to to your remote repo.

Push code to github using code

  • Step 08

Now you have pushed your project to your remote repo. So now it is on your personal github. Now you might be thinking about how to link this with the original project repository. That is very easy. Now you want to do is, just press on Contribute and then Open Pull Request.

Raising a Pull Request

Hooray! Congratulations! You have now completed all the steps and you have now contributed for an open source project!

Conclusion

What Happens Next?

So now you may have a curiosity about what's happening under the hood after you raise a PR. So after you made a PR, a PR will be shown on the owners of the original repo. They can visualize the changes that you have made to the codebase or the project and evaluate them. After evaluating, the best matching solution will be merged to that original repo and it will be keep forever with as a part of that repository.

Some Final Words

So today in this article I talked about how to contribute to an open source project, step by step in a very easy manner that a children could also understand. So it is a fact that you keep in mind that this procedure can be something different from another open source repo which you will find on github. That's because of these are specialized into organizations and there business models. However, if that is so, the most of the steps are same and you don't have to make any upset with that. Only a little few steps may be needed to change and those are also be guided by documentations like this that you are now reading on!

So start contributing to open source projects and become a hero on planet earth!


要查看或添加评论,请登录

Tharindu Kalhara的更多文章

  • How to Build a CI/CD Pipeline for Docker

    How to Build a CI/CD Pipeline for Docker

    Today I’m going to explain the process of teaching you the way of automating the building and pushing of docker image…

    2 条评论
  • HTTP Verbs ? Here…

    HTTP Verbs ? Here…

    Introduction Today we are going to deeply dive into understand the concepts of HTTP VERBS. In internet, HTTP — Hyper…

社区洞察

其他会员也浏览了