How to Start Contributing to Open Source
If your work as a software developer is not directly related to open source (i.e. you don’t spend most of your working time supporting or contributing to an open-source project), your GitHub profile may be blank, except for some study projects and test assignments.
This is not necessarily bad, and it doesn’t make you a bad developer. But probably you’d like to create outside visibility of your work and boast some green tiles on your GitHub contributions timeline. So here’s a couple of tips to get you started.
Find Time in Your Working Hours
Woah, this is certainly not about sneakily hacking on open source projects in your working time — that would most likely be a violation of your contract, as this is not what you’re being paid for.
But come to think of it: surely you use at least some open-source libraries or frameworks in your project — so you could start with identifying a bug or a lacking feature that you’ve hit upon while working on your project. So fixing this bug or implementing a feature would benefit both you and your company.
For example, if you’ve already spent some time investigating a bug in your code, and finally came to the conclusion that this is a bug in a library that you use, check out their GitHub issues page and create one, if it still doesn’t exist. You may already have an understanding of what needs to be done, so you could approach your team lead or manager with an idea to contribute a fix to this library.
This is quite a common practice in my company, where we often create pull requests to fix bugs and promote new features for the libraries that we use.
Find Time Outside of Work
This may be tough, as we all have our hobbies and personal life, and we wish to spend time on something outside of work. But think of it as an investment into your learning and sharpening of your skills, or having fun with some cool stuff that you don’t get to do on your daily work.
For example, if you currently read a book to learn a new language or framework, even if you don’t use it at work, a great practice to support your theoretical knowledge is to get your hands dirty in an open-source project that’s written in this language.
Find a Project
There are lots of projects on GitHub that accept contributions. The majority of project maintainers would be happy to get some help — believe me, they have more than enough on their plate, that’s why some issues with lots of thumbs-up stay open for a long time.
If you already know a project you’d like to contribute to, just open it on GitHub, head over to the “Issues” page, and search for issues with labels good first issue, help wanted, or something along similar lines. For example, here’s the link to search for good first issues in the Kubernetes project, in case you want to practice the Go programming language, and you are interested in cloud deployment: https://github.com/kubernetes/kubernetes/labels/good%20first%20issue
You’ve probably used awesome lists on GitHub — curated collections of great links and projects related to a particular topic. Well, if you’re looking for a project to contribute, there’s one awesome list specifically for you, called awesome-for-beginners. Lots of projects that need help are collected there, grouped by language.
Another place to find open source projects in need is CodeTriage, where you can search for the projects, subscribe to the one that looks interesting to you, and get an issue for triage daily, right into your mailbox.
Prepare to make a Pull Request
Before even starting to work on a PR, it’s a good idea to check if the issue you’re trying to solve is not yet assigned to anyone, and nobody is actively working on it. When in doubt, write a comment under the issue and ask.
If the issue you’re planning to work on is not even on the GitHub yet (for example, if you’ve found a new bug or want to implement some new piece of functionality), it’s better to create a GitHub issue first and ask if you could provide a PR. This bug may be already known, or the maintainers may consider that they don’t want to incorporate your idea into their project for some reason.
Some projects will require you to sign a CLA (Contributor License Agreement). The point is basically to make sure that you agree to distribute your contribution under the license that is used in this project.
This signing request is usually done online and doesn’t require you to physically write your signature on some piece of paper. Instead, you’re referred to a separate page for signing the agreement by approving the authorization request on GitHub. Read through the agreement carefully.
One thing to note is that if you’re asked for an email during this process, this should be the same email you use in your commits. Otherwise, your PRs may not get accepted.
The next thing to do is to check out the Code of Conduct and Contribution Guide for the project. There are usually files aptly named CONTRIBUTING.md or code-of-conduct.md in the root folder of the project. Those describe what’s expected of you as a contributor. Whenever you’re ready to make a pull request, double-check the code style and other topics of the Contribution Guide.
Submit a Pull Request
I won’t duplicate the official GitHub documentation on submitting a PR. I will only note that it’s usually easier to implement your changes in a separate branch of your forked repository right from the beginning. The branch could be named something like issue/12345, where 12345 is the issue number you’re working on.
Make sure your changes are well documented, and the commit message clearly explains your contributions. A good practice is to add something like Closes #12345 to the commit message — this will get parsed by GitHub, and the PR will get attached to the corresponding issue automatically.
When you’ve submitted your PR, be patient if you don’t get a response right away. The maintainers may answer shortly, or may as well be silent for quite a while, since they may have more critical PRs to tend to. If you don’t receive any response in a couple of weeks, politely mention someone from the project’s maintainers and ask whether they had time to check out your PR.
Conclusion
I hope these tips will help you in starting your first contributions on GitHub. This is not that complicated, really, and the first issue you solve will bring you a great sense of accomplishment. There are lots of projects out there waiting for your help, so start coding!