CodeNewbie Community đŸŒ±

Cover image for A beginner friendly guide to making your first open source contribution
Fum for Inspirezone Developer Community

Posted on • Originally published at inspirezone.tech

A beginner friendly guide to making your first open source contribution

Get involved in Hacktoberfest and submit a PR to any of the GitHub inspirezone repositories.


Contents


Introduction

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 also allow contribution 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 organised.

Let’s 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 those who just want to improve on how you interact with public repositories.

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. Maintainers of repositories will certainly appreciate those that follow these guidelines as it makes 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.
GitHub fork

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. Since 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 the 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.

GitHub issues section

How a repo issues section looks like.

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.

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.

GitHub action sample report

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 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.

Alt Text

Notifications on github.

I thought it was worth noting the importance of GitHub notifications because being notified and responding to comments on your interaction with public projects is an important part of the process. Communication is key to the running of open source projects and this will make sure you don’t miss any important updates!

2. Read the docs

GitHub docs

Some documents typically found on public repos.

Most repositories that 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.md

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

GitHub readme

An example README file on one of the inspirezone GitHub repos.

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.

GitHub licence file

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.md

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 are any branch naming or commit messaging guidelines. Some repos will also require filling a pull request template when you submit a pull request.

Following the rules listed in the CONTRIBUTING file are key to improving the chance of your contribution being accepted so pay attention to them!

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

Open source do and don't

Don’t:

❌ Don’t ignore the repo documents. Pay attention especially to the README.md and CONTRIBUTING.md. 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.

Do:

✅ 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 repositories 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 that 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.

As some extra motivation checkout the post 10 incredible projects that show the power of open source. Open source shows the amazing things that can happen when developers come together so consider becoming a part of the community 🙂

Do you have any concerns about getting started with making open source contributions? If you’re a maintainer or make contributions already what advice do you have for others? Comment below!


The inspirezone GitHub community hosts repositories with “good first issue” tags. Check them out and consider making your first open source contribution with us! You can also sign up to our community to gain access to discussions with other members and get involved in our portfolio of open source projects in exclusive ways.

Oldest comments (0)