How to make your first contribution to Open Source? A Beginner's Guide

roligautam

Roli Gautam

Posted on July 28, 2021

How to make your first contribution to Open Source? A Beginner's Guide

I know that you might be thinking🤔 that Is this blog really help you to start your open-source journey? So, I promise you that after reading this blog, you will definitely feel much confident to make your first open-source contribution.

Alt text of image

I am sure that you might be hear about the term “open-source”. And you might be thinking What exactly is it? How can you contribute in it? What are the tech or tools need to know to do open source? How can you get started? So, you are at right place. In this blog, I will cover all this and much more.

1. What is an open source?

Open Source refers to the source code that is available for modification, enhancement and anyone can use freely. Open-source software is usually developed as a public collaboration and made freely available. Anyone can also contribute in the source code to make it better. GitHub is also an example of an open collaboration.

2. Why should you contribute in an open-source program?

This is the first question that arises in our mind that why should you contribute to open-source programs?
So, there are plenty of purposes such as :
• Learn new skills
• Share your knowledge
• Grow together and learn together
• Gain experience in Real-World Development
• Build your Networking with like-minded peoples
• Networking will help you to grow your career
• Know about the workflow of Git and GitHub
• Brushed up your skills

3. Who can Contribute? What do you need to participate in an open-source program?

If you are a beginner then most probably, these questions arise in your mind. And you might be thinking that, Are you eligible for this program or not? Well, the answer is Yes. You can contribute to open-source programs.

Alt text of image

Well, For contributing to any open source program, you don’t need to have a deeper understanding of any tech. Just need to learn the basics of any tech according to your interest and make contributions.

Let's say, If you know only the basics of HTML and CSS, then you can contribute to any open source project of Web development. You can make changes in the UI of that project, change color or change the font style. These are very basics issues and you can easily contribute to them.

Tip-1 : I know, you are much excited to make your first open-source contribution, but before going through all these steps, I would recommend you to go through this Git Cheat Sheet and download it on your local PC so that you can review it in future.

4. How to get involved in an open-source program?

The first step is to register yourself for any beginner-friendly
open-source program.

There are some beginner-friendly open-source programs like :

• GirlScript Summer of Code(GSSOC)
• Lets Grow More Summer of Code(LGMSOC)
• Script Winter of Code(SWOC)
• Delta Winter of Code(DWOC)
• NJACK Winter of Code(NWOC)
• Kharagpur Winter of Code(KWOC)

Checkout this to know about more open-source programs and open-source competitions.

After enrolling yourself, I am pretty sure that you will get selected.

Tip-2 : Try to fill the application form carefully and write your answers properly, You will definitely get selected.

5. How to choose an open-source project?

This is a very crucial step. After getting selected, visit on the official website of that open-source program and Check projects according to your tech interest and convenience.

Within those projects, whenever you catch yourself thinking that something could be better or altered, act on your instinct.

And Make sure, your selected project will follow these things :

• The project must have a license
• It should be a recent project that means mentors and admin are active
• Make sure, people are contributing to that project
• There should be an active discussion on the project issue
• Check that mentors are reviewing pull requests of the participants

If all the above conditions are satisfied by the project then you should go for that project.

6. Create your first issue

• After selecting a project, open that project on GitHub
• And check what can you make changes so that this project becomes better?
• Now, after finding an issue on which you can work without any difficulty, visit that project on GitHub .
• There will be a section of Issues as shown in this image :

Alt Text

• Click here and you will find a option of New issue

Alt Text

• After clicking on New issue, you will find some type of issue as shown in this image:

Alt Text

• You can choose any option according to your issue type.
• And Fill all the details of your issue and click on Submit new issue button.

Alt Text

Congratulation!đź‘Ź Finally, you created your first issue.

Tip-3 : I would suggest that you should describe your issue properly and also mention that how will you solve this issue.

7. What can you do to get assigned that issue to you??

• After submitting your issue, Wait for 2-3 days and a mentor or admin will assign you to work on that issue.
• If you are not getting any response from a mentor then you can text them on the discord channel (most of the open-source programs make a discord channel).

• After that, I am pretty sure that you will get assigned and get a message on GitHub something like this :

Alt Text

Tip-4 : I would suggest you to text individually to the mentor on discord or any other platform like LinkedIn, So that they can notice your message and assign you.

8. How to start working on the project?

If you followed all the above steps, then you are good to go.🙌 So let's talk about how to actually start working on the project?

There are few steps such as :

(i) Fork the project : At the top right corner, you will see the term fork. All you need to do is click it and you will have created a copy of the same project in your account.

Alt Text

(ii) Git SetUp : Now, first thing is need to set your Git environment so that you can work on that.

If you have Git installed then open CMD, but if you haven't then install it from here.

There are two steps to setup your git environment :

(a)Set your user : You need to set your user name because every git commit use this information. So use this command to set your user name :

$ git config --global user.name "Your_Name"
Enter fullscreen mode Exit fullscreen mode

(b)Set your email address : Also you need to set your email address and for that use this command :

$ git config --global user.email <your_email@gmail.com>
Enter fullscreen mode Exit fullscreen mode

Finally, you are done with the Git Setup. Now, You can work on that.

(iii) Initialize your Project as a Git Project: Before cloning the project, first thing is to initialize your repository as git repo. So for that, run this command:

$ git init  
Enter fullscreen mode Exit fullscreen mode

This command is used to create a new blank repository and to make an existing project as a Git project.

Alt Text

(iv) Clone the project : Now, You need to copy the link of that project, which will be available under the Code option as shown :

Alt Text

So, now to clone the repository, use this command :

$ git clone <url>
Enter fullscreen mode Exit fullscreen mode

This command will create a copy of the project on your local pc.

Alt Text

(v) Create a Branch: Before start working on the project, you need to create a branch. Run this command to create a branch:

$ git checkout -b <your_branch_name>
Enter fullscreen mode Exit fullscreen mode

Alt Text

• As shown in the image, before creating the branch, we were in the master branch.
• After creating a branch, we will enter into our newly created branch
• We can also check all the branches present in the project by using this command:

$ git branch
Enter fullscreen mode Exit fullscreen mode

Alt Text

• Now, you can see in the image that there are two branches in our project:
a. master branch: This will always be present in your project as default or main branch.
b. new branch: This is our newly created branch.

• We are in our newly created branch newbranch that’s why it is shown in green color and now, you can write your code in that project.

Tip-5 : Try to run $ git status command as much as possible to check the status of your project at any instant.

$ git status
Enter fullscreen mode Exit fullscreen mode

9. Add and commit your changes:

After making the required changes in your code, you need to add and commit these changes to your project.

• To add your changes run this command :

$ git add -A
Enter fullscreen mode Exit fullscreen mode

• Run this command to commit :

$ git commit -m "Your_commit_message"
Enter fullscreen mode Exit fullscreen mode

This command is used to create a snapshot of the staged changes along a timeline of a Git project's history.

Alt Text

After running the $ git status command, we can see in the image that the working tree is clean.

You can also use git log command to check the history of commits that are made in the repository.

$ git log
Enter fullscreen mode Exit fullscreen mode

After running the $ git log command, you might be thinking that how to return back to your CMD. So, for that Press the q key to return to your command prompt.

Tip-6: Write your commit message properly. You can write about what you made changes in that repository?

Let's say you created an issue to make changes in a submit button. Then your commit message should be like :

$ git commit -m "Modification in submit button" 
Enter fullscreen mode Exit fullscreen mode

10. Push your project to the GitHub

Now, you need to push your project. The git push command is used to upload local repository content to a remote repository. Use this command for pushing your project :

$ git push origin <your_branch_name>
Enter fullscreen mode Exit fullscreen mode

or

$ git push --set -upstream origin <your_branch_name>
Enter fullscreen mode Exit fullscreen mode

Alt Text

Tip-7: You are doing great. Just try to explore more git commands. And if possible, you can take a print out of the CheatSheet and paste it near your study table.

11. Create a pull request :

After pushing your project, visit on GitHub and there you will find a big green button of compare & pull request as shown in the image :

Alt Text

Click on that and create a pull request in the given format of that project such as :

Alt Text

Tip-8 : You can also commit an additional message as shown in the image, so that mentor can review your pull request soon.

Alt Text

Congratulation!🤩 Finally, you created your first pull request. You should feel proud on yourself for making your first contribution to an open-source program.

Alt text of image

đź’– đź’Ş đź™… đźš©
roligautam
Roli Gautam

Posted on July 28, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related