Yuri
Yuri's Notes

Yuri's Notes

The ultimate contribution guide to Open Source

The ultimate contribution guide to Open Source

Yuri's photo
Yuri
·Oct 1, 2022·

7 min read

Subscribe to my newsletter and never miss my upcoming articles

Play this article

Table of contents

Ahh, it's that time of the year again! No, not Christmas, Hacktoberfest! And you’ve found a project you want to contribute to… How do you do that?

This is the ultimate guide I wish I had when I first contributed to Open Source. I'll walk you through the lingo used and how to make a successful contribution.

Ready?? Let 's get started.

What is Open Source

Open Source Software (OSS) is code that can be easily accessed by the public, making it able for them to see, modify or distribute said code. Open source is often decentralized based on community collaboration.

Some of the benefits that make people be really enthusiastic about OSS is that it can be easily reviewed. Since the code is accessible to anyone, this can lead to the code being improved, there is a lot of transparency between what the code is doing and what you’ll be implementing it on. It also offers a lot of flexibility since its community based, it allows for more innovation from your users because they’ll be discovering new usages of it, benefiting the whole project through collective innovation.

When you see OSS being ‘free software’, it does not mean price wise, it means users get the liberty to edit, review and redistribute it freely.

A lot of OSS have very engaging and friendly communities. Try joining and see how you can help them solve some issues they might be encountering. They might also walk you through guides they have in place and how to make a successful contribution making some great connections along the way.

What is GitHub and how to use it for contributions

GitHub is an open source version control software that lets people make changes to code and keep track of them. In case anything goes wrong, you can go back to the previous code that worked. It also enables real collaboration, making it easier for teams to work together on the same project.

How can people contribute to the same project from different devices?

Forking a repository and cloning it using GitHub and Git

Let’s clear up the terminology and tools we’ll be using:

  • What is forking? It’s creating a copy of the repository.
  • What is a repository? Think of repositories as a way of storing code. It can contain several versions of a single Project.
  • What is Git? It is an open source version control system that allows you to keep track of your code history and upload said changes to GitHub.
  • What’s the difference with GitHub? Github is a cloud-based HOSTING service that allows you to work and manage GitHub Repositories.

How to Fork a Repository? You can navigate towards the repository you want to contribute to and click on the Fork option. If you don’t have any idea of which repository to contribute to, you can search on GitHub for the labels good first issue, beginners or even language specific like javascript.

Fork

You’re going to click on Create a new fork, this is going to take you to a page where you need to select an owner/user for the forked repository. You can also change the name or leave it as it is and add a description.

Choose which branch you want to copy.

  • What is a branch? Think of them as the branches of a tree. They allow you to make modifications without affecting the ‘main’ branch that would be the trunk in this analogy. They will help you submit your changes later on.

Now all you have to do is to Create fork. This will make it appear on your GitHub account, but for you to actually work on it and make changes, you need to clone your Fork to your local device.

To get the link of the Forked repository, go to the Code tab.

code

Here you have several options on how to clone your newly forked repository:

  • HTTPS will give you the link so you can use the command git clone on your terminal
  • SSH keys are used to authenticate the remote communication between a client and a local machine
  • To clone it using the GitHub Command Line Interface (CLI) select GitHub CLI

Now you need to open a new terminal on your device, move over to the directory on your computer you want a copy of this repository.

  • You will need to have Git installed for this step.

Copy this into your terminal and replace LINK with the one you copied in the previous step.

git clone LINK

Now, when you hit enter, your local version will be created. You can go ahead to your preferred code editor and start working on the project!!

How to submit changes

Submitting changes is known as pushing changes.

Once you’re done making the changes you wanted to the Repository you cloned, you need to stage those changes,

  • What is staging changes? Is making Git save that change as the ‘current’ version of the project.

You do this by opening a terminal, and copying

git add .

The dot is going to make all the changes be staged, instead of just one specific file.

Once that is ready, you’re going to commit those changes by

git commit -m “short description of the changes you made”

This will help when you check out GitHub and see a description of the changes that you made. Right now, all of these changes are made locally. For you to push them, you need to:

git push origin master

and hit enter, this will update the Forked repository on your GitHub account with the changes you made locally and the quick description you added while committing the changes.

Now here’s the most important part; actually proposing the changes to the main project!!!

Making a Pull Request (PR)

You head over to the GitHub Repository where your edited project is, you’ll see that your branch is one commit ahead of — which is the branch you forked earlier.

You need to click on Contribute and then Open a Pull Request

Now all you need to do is to click on Create Pull Request and that 's it!!

You’ve just made your first Open Source contribution!!

What to expect after making a Pull Request

Most of the time, if your Pull Request is not what they were expecting, they’ll probably comment on some specific things you need to fix and then submit it again, but if everything is fine your PR is going to be accepted and you just helped them increase the value with your experience.

If it gets rejected, it’s totally fine. You can join the community and check if there’s anything you can help them with. If there isn’t anything, you can always look for other labeled issues on GitHub that interest you.

What if I don’t have any technical knowledge

Don’t worry, contributions are not all about code. Documentation, translations, clarifications, technical articles and many more are now being taken into consideration for Hacktoberfest 2022 and in many other projects, not only for Hacktoberfest.

The ripple effect this will have is going to be seen in the upcoming months after Hacktoberfest when a lot of documentation is improved and more content and guides around projects are made, increasing the overall quality of OSS.

Fun Hacktoberfest 2022 events

Some fun Hacktoberfest events taking place are:

And many more! If you know about any others please let them in the comments :]

If you have any other questions, don't hesitate to contact me on Twitter

Thank you so much for reading and remember, contributing to Open Source is not only an October thing!


☕If you enjoy my content Buy me a coffee It'll help me continue making quality blogs💕

💙Follow me on Twitter to know more about my self-taught journey!

💜 Web Design for Beginners Series

💜 JavaScript For Newbies Series

❤️ Also subscribe to my Youtube Channel !

🖤And for more content and tips on TikTok !

 
Share this