How to Contribute to Open Source Projects – A Beginner's Guide

ikshwaku03

As we continue to advance technologically, more and more products and services are being transformed into software ready services. And many of them are being made open-source.

Most developers and companies depend on open-source tools and software to make their products work. And I think you’ll agree with me that the number of contributions to open-source have really grown lately – not just for solo developers but from companies also.

My first ever contributions to the open-source community was during the yearly Hacktoberfest event in 2023. As a beginner I participated in beginner friendly projects which I will be sharing later to help you out too.

Now, if you are reading this article it’s because you want to be part of the great open-source community – but maybe you don’t know where to get started? Well, you are in the right place.

In this guide we will cover:

Well, in this article we will cover all this and more.

Let’s get started!

What is Open Source?


In simple words, we can describe an open source project as source code that is made available to the public to view, use, modify, and distribute under a permissive license.

As an example to explain this, let’s use a classroom scenario. A teacher can share a document on a platform like Google Docs. On this platform students can edit the document and even make copies of their own. But whenever they make edits they have to be approved by the teacher before reflecting on the document again.

That’s how open source code works: once it’s been made public, and you need to add a feature or make changes, the owner has to approve the added changes and publish them for others to see.

Most successful open-source projects are a result of contributions from people with all skill levels – and not only coding skills, but also other skills like writing, languages, and so on.

Any time someone fixes a typo, adds an alert about a possible compiler warning, fixes a bug, or even adds detailed documentation to a project, progress is made. If we take all these small contributions from different people with different skills and put them together, great things can happen.

Just as Vincent van Gogh said:

Great things are done by a series of small things brought together.

Why you Should Contribute to Open-Source


Contributing to open source projects can be a rewarding way to learn, teach, share, and build experience.

There are plenty of reasons why you should contribute to an open source project, such as:

Step by Step Guide on How to Contribute to Open Source

When we say contributing to open-source, it does not necesarilly mean that you need to know how to code. There are different ways in which you can contribute even if you are a non-coder – but having some coding skills will help you (and the projects) out a lot.

Some common contributions can be through:

All these ways, and many more, count towards contributions. Now what exactly should you know before you start contributing to an OS project?

What to Know Before Contributing to an OS Project


Just as we expect each open-source products to be different, so are the communities. Each community has it’s own rules and will have different guidelines and roles, and if you are lucky some also do give rewards after you contribute.

But despite all this, there are some common features which apply across all OS projects, and that’s what we are going to talk about:

Roles in a typical OS Project

In a typical OS project we will have the following people:

Must have elements in all OS projects

When talking about an OS project, they are categorized in several ways depending on structure, type of product platform, programming language used, whether it’s sponsored or fully independent, and more.

All this info should be outlined with the help of the guidelines and information:

As an individual or an organization running an Open-Source project, it’s all about creating a community where people can grow together. This means that you will have to develop a friendly environment where people will get to share ideas, work on challenges, and even have random chats at some time.

There are some go-to options here, and you can use tools like:

So, now you have an idea of what an OS project is and what to expect when you contribute to one. Moving into the most important part, how do you know which project to contribute to?

How to find an Open Source Project to Contribute to

Contributing works on all levels, there is no need to over think how you’re gonna do it. Instead think of some of the projects you already use and how you can make a change to them or improve on them.

Research has shown that around 30% of casual contributions are documentation, typo fixes, or even translations.

At the begining I promised to share some of the projects that helped me out when I made my first contribution. Well lucky you, if you are a first-time contributor – which everybody is at some point – here are some links that will get you started in the open source world:

Quick hack for you In the world of open-source software, issues get reported and fixed pretty quickly. So, a good way to kick start is to take on an issue and be sure to try to work on it promptly.

How to choose an Open-Source Project

After you have found the project you want to contribute to, it’s time to do a little vetting. Make sure it meets the following criteria so you know it’ll be a good project to work on:

  1. Check out if it has a license file.
  2. Check when the last commit was made. This will help you know if the maintainers are active and also give you an estimate on how long it will take to respond to your contribution.
  3. Look for the number of contributors.
  4. Check how often people make commits.

If you see lots of recent activity that’s a good sign – it means the community is active and so are the maintainers.

Now, if the first “vetting” checks out, proceed to checking the following points too:

  1. Does it have any open issues? If yes this might be a good sign, you will have a place to begin.
  2. How long does it take for maintainers to respond? This will be determined by how often issues are closed and PRs merged.
  3. Is there an active discussion on an issue?
  4. Are the issues getting closed regularly?
  5. How many open pull requests are there?
  6. How recently was the latest pull requests merged?
  7. Do the maintainers thank people for contributing?

If this final vetting process checks out, then you are good to go and start your contribution.

What to Consider Before You Go Open Source

I know you are excited and ready to rock the OS world, but do you know what to look for in a project?

As mentioned above, there are different ways in which you can contribute. But before you make your first contribution it’s good to note a few things about the project you will be choosing, like:

Once you’ve found a project, you’ll want to actually make contributions. And you’ll do that by submitting pull requests. Let’s talk about that now.

What is a Pull Request?

Remember the example about Goggle Docs? Well, a pull request is similar only this time it’s about code.

We can describe a pull request as when a contributor submits changes – wether it’s code, documentation, or elsewhere – and asks a maintainer to check it out, make sure it’s fine, and then merge it to the base project.

So, how do you submit one?

How to Submit a Pull Request

If you are at this stage, it means you have found a project and you are ready to make your contribution. So let’s talk about how to actually submit a pull request.

Steps to Submit a PR

fork-repo

After this operation the URL of the project will change to:

https://github.com/<YourUserName>/projectname

Copy the forked project URL, and proceed to your local machine where you will open git bash, and proceed with the command below:

git clone https://github.com/<YourUserName>/<projectname>

This will create a copy of the project on your local machine. Now that you have cloned the repo we will need to do two things:

First is to make the necessary changes/contribution and commit those changes. After making your changes and adding new files, its time to add those changes into a separate branch before pushing them to remote.

But, first let’s create a branch. In your git bash, change the path to pint to your repository directory. To do that use this command:

cd project folder name

Now, to create a branch we will use the command: git checkout

git checkout -b your-new-branch-name

Here’s an example:

git checkout -b lary-mak

It’s time to add the new changes into the branch we created. In order to see all the changes you made, we will use the git status command:

git status

The command will list all the changes you made. To add them we will use git add *, which will add all the files to our branch.

git add *

Let’s add a commit message, briefly explaining what we added:

git commit -m "<message here>"

replacing <add-your-branch-name> with the name of the branch you created earlier, in my case it will be git push origin larykmak.

Soon the maintainer will merge all your changes into the master branch of this project (unless they need changes from you). You will get a notification email once the changes have been merged.

Creating a pull request has some advantages, like:

Congratulations 🥳🎉,
You just completed the standard fork -> clone -> edit -> pull request work-flow which sums up to your first contribution. You’ll use this often as a contributor! So, what next?

What next after your First Pull Request?

That does not mark the end! Now, just find more projects and keep contributing. Also be sure to be on the lookout for the one month dedicated to open-source contributions every year that’s run by Digital Ocean for a chance to win some amazing gifts.

One more thing to talk about a bit more before we end. That is, why contributing to OS is rewarding.

Benefits of Contributing to Open Source

Why You Should Contribute to Open Source as a Developer

Wrap Up!

As I mentioned, open source is open for every one to participate. There are a lot of opportunities you can take advantage of and learn something new. All you need is to decide to begin and get started.

OPEN-SOURCE IS WAITING FOR YOU

If you have read this far, I really appreciate it.