Open Source Introduction and Steps to contribute

Srishti Poudel
5 min readOct 9, 2020

--

What is open source?

In general, open source refers to any program whose source code is made available for use or modification as users or other developers see fit. Open source software is usually developed as a public collaboration and made freely available.

Why open source is important to learners?

Developing open source projects/ software knowing that anyone can see our code and make comments, it takes developer to next level. In simple word, learners can take the idea to build their projects/software or even can contribute to the project with the knowledge what they have.

This might sound funny but in most of the cases, we can provide our first contribution simply by editing the Readme files. If you are learning something and want to work on real life problems, open source projects might be the best options for you to start.

What do you need to do to make open source contributions?

For the open source contributions the most essential knowledge that you must have is the concept of version control. Since you will be working remotely in the projects and in order to make them available online or in order to merge them in the main project, version control (E.g. Git) plays a vital role in this regard.

The next thing you need to have knowledge is one programming language and like proficiently. I am telling this because there are lots of open source projects you can work on and they have different types of programming languages used in the project. If you have enough knowledge regarding one programming language, it will be easier to work in qualitative basis rather than quantity. From my experience it is better to have knowledge regarding algorithms and data structures. This will be like “adding cherry on your cake”.

Where we can find open source projects?

GitHub is the best place to find open source projects. GitHub is a website/service that allows you to host your git repositories so that you don’t have to set up your own server.

How to contribute in an open source project?

  1. After finding open source project, you first need to fork the project. This is because when you want to make changes in the code of the project, it is not allowed to make changes directly in the main project. This is only allowed for the owner/ maintainer of the project. In order to make changes in the main project, first we need to make our copy of the main project. For this we fork the main project in our account.

After forking the project in your account, it looks like this. You have your own copy of the main project in your account.

2. Next step is cloning. Clone basically downloads all the files of the copy of main project in your account to the desktop/computer. For this go to the code dropdown button and copy the link:

Now go to your git bash and clone wherever you want, by using the syntax:

git clone <copied-link>

After cloning you will have all file in your specified folder. Git automatically links the project to the pasted URL. You van also see that by using:

git remote -v

To see what is the origin of the pasted link, use:

git remote add upstream <pasted-link>

3. Go to the original project and look for issues.

4. After finding the issue, go and see what task are already done and what are remaining to do. According to your wish select one task and comment down it in the issue. After commenting, if the task you wanted and commented in the issue is available, maintainer will assign you.

(Steps 1, 2 and 3 can also be done after commenting)

5. Now in order to create a new pull request, you need a new branch. And that branch is something that is going to be merged in the master branch. So create branch using:

git branch <branch-name> inside project folder.

Now move inside the branch using syntax:

git checkout <newly-created-branch-name>

All the changes that you make will be made in new branch that you created instead of master branch.

6. Now open the project folder and work on assigned task. After making changes, go to the project structure and do :

git status

you can see the modified file in red color.

7. Now to track this changes do:

git add .

8. Now commit using syntax:

git commit -m “Your message”

in order to commit with message that help the maintainers to know what commit that you have specifically made.

9. Now this changes are not online. In order to make this changes online, first push the changes in your copy of the main project in GitHub using syntax:

git push origin <branch-name>

On doing this, your copy of the main project in GitHub will look like this:

The compare and pull request option will show upon the branch that you have made changes.

10. Now, Click the compare and pull request button and add specific task that you did and create a pull request.

Now the maintainer will check your commits and decide whether to merge it on the original project or not.

After your pull request is merged, it will look something like this:

This is all what we need to do for open source contribution. Hope this blog was good one for you to start contributing on open source from today itself. Thank You ! Happy Codding ! :)

--

--