paint-brush
Open Source Contribution for Dummies: A Quick Guide for Beginnersby@fum
309 reads
309 reads

Open Source Contribution for Dummies: A Quick Guide for Beginners

by FumOctober 16th, 2021
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Getting involved in open source shouldn't be scary. Knowing how to use git and GitHub features is crucial to understanding the process of making submissions to repositories. Open source projects also contain documents such as the README and CONTRIBUTING files which should be read carefully to understand the rules and guidelines for making a contribution.

Company Mentioned

Mention Thumbnail
featured image - Open Source Contribution for Dummies: A Quick Guide for Beginners
Fum HackerNoon profile picture


Open source generally refers to applications anyone can use for free while also having the freedom to view and modify the source code.


Open-source projects allow contributions from the public. This means anyone (yes, even you!) can modify the source code or make other forms of contribution to the project.


Although open source is certainly open to everyone, there are some unofficial rules and guidelines we should all strive to follow as closely as possible to keep the repositories for open source projects organized.


As a maintainer of the inspirezone GitHub repositories, experience shows it’s mostly simple rules that need to be followed by those who wish to contribute.


We’ll go through some key points to keep in mind when you’re making a first open-source contribution to repositories on GitHub. This also applies to anyone who wants to improve on how they interact with public repositories.


Maintainers of repositories will certainly appreciate if you follow these guidelines as it will make the maintaining process much simpler!


1. Be aware of Git and GitHub concepts

If you’re new to git and to the GitHub platform, there are a few things you need to become familiar with.


As a simple definition, git is a system for managing source code changes and GitHub is an online hosting platform for your git repositories.


There are some features and concepts provided by git and the GitHub platform that play an important role when contributing to open source.


Take some time to learn the basics of git as it’s a crucial skill to know for anyone serious about contributing to open source.


Here are some functions of git and GitHub that especially apply when making open source contributions.


Forks

Forks are a feature available on GitHub that allow you to make a copy of a public repository. When you fork a repository you are copying it and transferring it to your own profile.

Click on the fork icon to make a copy of a repo.

Forking is an important step in making a code change to a public repo. Because you don’t have direct access to making a commit to a repo not owned by you, forking allows you to create a copy where you’re free to make your changes first.


Once you’ve updated your fork with changes you want to make to the public repo, you can then submit your changes through a pull request.


Read more about forking in the official GitHub documentation.


Pull requests

Pull requests are a way of submitting changes to a public repo. When you make a pull request, the changes made on your fork of the repo is submitted to the original repo.


Maintainers receive pull requests and can review them before deciding to merge your changes.


When your pull request is accepted and merged, it means your changes now become part of the public repository!


Read more about pull requests in the official GitHub documentation.


GitHub Issues

‘Issues’ are a feature of GitHub. They are sections present on a repo page and act like discussion threads to raise any issues relating to the repo project.


 How the issues section looks like for a repo.

In an issue section you can do things like raise bugs, request a feature, ask a question, suggest a bug fix, suggest an improvement or anything relating to the repo.


Depending on what is detailed in the contributing guidelines, raising an issue or requesting to be assigned to an existing issue may be part of the steps involved in making a contribution.


Read more about Issues in the official GitHub documentation.

GitHub actions

Be aware that some repos use GitHub actions.


These are automated checks that may be run on code you submit to a public repo. They allow repo maintainers to quickly catch any code errors or violations of the contributing rules.


For example, take a repo with guidelines stating submitted code should follow a particular linting formatting e.g. flake8 for Python.


A GitHub action may run to check your code meets the flake8 linting standard. If the check fails, it will be shown on your pull request and you’ll receive a notification.

Example result of a GitHub action run showing one pass and one fail.

GitHub actions are not limited to just code changes. They can also trigger from your interactions with the Issues section or any interaction you have with the repo.


To be sure your contributions will pass automated checks like this make sure you read the repo contributing guidelines!

GitHub notifications

GitHub will notify you if there’s any change to the status of your proposed contribution.


For example, you’ll receive alerts if there’s new comments in Issues you’ve created and for comments and code reviews to your pull requests.


Just make sure notifications are enabled on your profile by going to your profile Settings -> Notifications and checking your alerts for various activity.


Communication is key to the running of open source projects. Keeping an eye on your notifications will make sure you don’t miss any important updates!

2. Read the docs

Some documents typically found on public repos.

Most repositories which are open to the public and welcome contributors will usually have a few documents that guide you on the purpose of the repo and how you can help out. These documents are:


README

This file is typically placed on the root page of the repo and is what you are greeted with when viewing the repo files.

README for TeachMeCLikeIm5 repository.

The README usually contains a description of what the repo is all about. Depending on the type of repository, it will contain info and steps on how to install and run the application or make use of its content. The README also typically points you to other useful information relevant to the repo.


License

This file is also typically found on public projects and details the license under which the contents of the repo falls under.


Most public repos will have a simple licence such as MIT that makes the content free to use, modify or distribute. You should pay attention to the license terms if you intend to use some of the repo contents outside of your own private use. For example, for any commercial use or distribution.


An example license file of a repo.

CODE_OF_CONDUCT

As the name describes, this is a document that lists the rules and regulations regarding what is acceptable when it comes to your conduct with the repo maintainers and other developers that interact with the repo. Read this and remember to be respectable when interacting with other fellow devs.


CONTRIBUTING

This is the key document to read to understand what is involved in making a contribution to the repo.


It will include details such as:


  • The types of contributions you can make.

  • How to alert the maintainer to the contribution you want to make. For example, you may need to create an Issue first.

  • Rules for the submitted code. Pay attention to things like code structure, formatting/linting, files and folder naming standards, requirements for code commenting, any required testing, and so on.

  • How to issue the pull request. If there is any branch naming or commit messaging guidelines. Some repos will also require filing a pull request template when you submit a pull request.


Following the rules listed in the CONTRIBUTING file is key to improving the likelihood of your contribution being accepted.

3. Do’s and Don’ts: The etiquette of open source contributions

Don’ts

❌ Don’t ignore the repo documents. Pay attention especially to the README and CONTRIBUTING files. Follow them and ensure your contribution meets the repo guidelines.


❌ Don’t make spammy or duplicate contributions. For large repos, pull requests may be immediately marked as invalid if it’s a duplicate of something already being worked on. It’s also not typically useful to issue a pull request fixing something like insignificant typos in documentation. (Major typos and mistakes in setup commands or the code can be acceptable).


❌ Don’t be afraid to ask a question about something you’re unsure of. Repo maintainers generally welcome your contribution and would be happy to help 🙂


❌ Don’t limit yourself to just code related contributions. There are other ways you can contribute such as reporting a bug, carrying out tests, writing or translating documentation, suggesting a feature and much more.


Dos

✅ Do have at least a basic understanding of git. If you’re completely clueless on git, the terms used in the docs and the process of making a contribution might confuse you.


✅ Do have a considerate mindset. Others will be reading your code and if it’s accepted it will become part of the repo. Keep this in mind when you’re making contributions by adding code. Ideally, add comments and documentation for your changes where needed.


✅ Do be patient. Refrain from pushing maintainers for an answer immediately as they could be dealing with several pull requests or issues at once. Maintainers may also have a lot to review and consider before providing feedback or merging your pull request.


✅ Do celebrate if your contribution is accepted!

4. How to find open source projects

Finally, how do you actually find open source repos you’re interested in contributing to?


Start on the GitHub explore page to search for public repositories. On this page, GitHub will recommend some repositories you might be interested in based on your profile and interests.


You can also search GitHub in more depth and use filters to narrow down on repos looking for contributions based on various filters and criteria. These include the programming language, level of difficulty of the task and various labels the repos will apply to attract developers.


For example, you can perform a search of repos using a label called “good first issue“, which is a popular label used to highlight tasks that are suitable for those new to open source contributing.


To help you get started click this link: is:issue is:open label:”good first issue” to perform a “good first issue” search on GitHub.


Other label searches you can perform to filter issues that are open and suitable for beginners include: “first-timers-only”, “easy”, “beginner”, “starter”, “up-for-grabs”, “good first bug”, “help wanted”.


Don’t give up if you can’t find a repo you’re willing to contribute to right away. There are tons of open source projects on GitHub. Keep looking and you will surely come across something that interests you eventually!


By searching for Issues with labels such as “good first issue”, you can find tasks that are suitable for those new to open source. There are contributions suitable for everyone so don’t be afraid to get involved!

Conclusion

Making an open source contribution shouldn’t be scary.


Remember that open source is really open to everyone of all skills and levels. The main point to remember is to always follow the guidelines listed by the repo maintainers.


Getting involved in open source is a great way to improve your skills as a developer as you’re dealing with code written by others and can pick up on various programming techniques. Not to mention you can get involved with some truly amazing projects.


If you’re determined to begin making open source contributions you will surely benefit from it.


Open source projects show the amazing things that can happen when developers come together so consider becoming a part of the community 🙂


Check out the inspirezone GitHub for beginner-friendly issues to tackle and consider making your first open source contribution. Learn more about the inspirezone community if you’re interested in getting involved with open source projects.


Previously published at: https://inspirezone.tech/making-your-first-open-source-contribution.