I love Open Source, contributing to it especially. To me, it gives me a great feeling inside, seeing my changes or additions being merged, which is my primary reason for contributing.
Getting started, however, is strangely hard. Where do I start? How do I know where to contribute? Will they roast me? How do I do it?
I’ll try to uncover some of the questions I initially had, hoping it might help you as well.
Getting Started in Open Source
Where to Start?
I’d recommend going to Open Source repositories that you already like and use, and look at the issues. Another thing you could do is browse the “first-timers-only” label on Github, which at the time of writing contains +800 issues in various languages. “up-for-grabs” is also decent. Another resource is MunGell/awesome-for-beginners.
Will They Roast Your Code?
People are different, and some are jerks, there’s nothing to do about it.. sadly. However usually it’s unlikely that anyone will be aggressive towards you for contributing, even for small things. I’ve for example fixed a lot of readme files (minor typos) and people always respond positively about it.
You can however attempt to avoid assholes by browsing the “first-timers-only” label (people are genuinely friendly there), and follow any contribution guidelines the repository might have. If you follow their guidelines, they have absolutely no reason to be snarky.
How to Actually Contribute?
I’ll focus on pull requests, meaning actually changing the repository. A pull request is a request to change something in the code, or another file. Depending on the size of your change, there’s two typical ways of moving forward.
Edit Files Directly on Github with Forks
Browse the Git repository, and find the file you want to change. There will be a pencil icon, which will create a Fork, and open up an editor view.
Make your changes, and click the “Propose file change” button below, and follow the few steps to create a pull request, consider checking the box “allow edits from maintainer”, so that the maintainer(s) can edit the code in case they have some minor changes.
Cloning the Repository
Find the Open Source repository you plan to modify, and locate the “Fork” button, top right.
You will now have a forked version of the repository, you can do with this as you please (respecting the license of the original repository!) Changes made are not visible in the original repository. You can now edit files directly in Github (as above) and create a pull request when you’re done. You could also clone your fork, and edit it in your favorite code editor.
I’ll clone using Git in my terminal:
git clone GIT_URL
You can now open the freshly created directory in your IDE or code editor, and make changes. When you’re done, you should commit your changes:
git add README.md git commit -m "Your commit message, e.g.: Fixed typo in README" git push origin master
Open up the fork on Github, and create a pull request.
Remember to add descriptive messages, and for visual changes add some before and after screenshots (recommended to me by Joanne, make your pull requests visual for frontend changes)
Where to Help, and What to Do?
Of cause, Github issues are low-hanging fruits, but simple things like fixing a typo in the README file, or even adding a new feature are things you can do. Writing some more tests can rarely ever hurt. Try increasing code coverage.
Not sure how to write good tests? Try the video course “Test Driven Laravel“.
Another thing is look for “Failing” badges on the readme, e.g. “StyleCI: Failing”, click it and find the reason for it failing.
Alternatives to Contributing
An other way of helping Open Source maintainers is reporting bugs, or even supporting them financially through Patreon or Open Collective (Example: Preact).
You Don’t Have To Contribute
Contributing to Open Source is far from necessary to work as a developer, but it can work as practice for working in teams, or just improving your skills. If you use a lot of Open Source libraries in your work, you should consider giving back in some manner.