loading...

How to Make your First Contribution to Open Source, A Step by Step Guide

scottstern06 profile image Scott ・4 min read

You want to contribute to Open Source! That’s amazing! The world thanks you! You’ve already thought it was a good idea and some google searches later, you’re here. Congratulations, let’s get started so you can join the army in making the software world, or the real world a better place!

In 2020, Open Source is the most popular it’s ever been! If you’re a developer or want to get into software development you will eventually come across the term “Open Source”, as a consumer of it and possibly a contributor to it.

Step 1 — Find a project you’re personally invested in!

My first contributions to Open Source was on Eslint. Am I super passionate about Javascript linting? No, not necessarily, well maybe, but I’m weird. It was a project I used daily and owed a lot of my learning to in the beginning of my frontend development journey. I saw an opportunity to dive deep into a tool I used daily.

Step 2 — Find an issue to work on

This one is pretty self explanatory, just go to this issues page of any repository and find an issue you think would be fun to work on. A few good labels to filter by are:

  • “Good First Issue”
  • “Good First Contribution”
  • “Accepting Merge Requests”
  • “Beginner Friendly”

These are just suggestions but every repository is a little bit different. The goal is to find issues that are “beginner friendly” and that get you working in the code base, getting used to the development/code review process. It’s entirely possible that the project doesn’t have any of these labels, if that’s the case, reach out to someone or comment on the issue asking if it’s a good first issue to tackle. Sensing a common theme here? More helpful links can be found here.

Step 3 — Claim the issue

This one sounds obvious but it’s not. Time and time again, I see multiple people working on the same issue. If the issue is unassigned OR the issue has been assigned but there hasn’t been any activity on it for a while, then go ahead and make a comment.

Finally, make a comment, something like:

“Hey! I am super interested in taking this ticket on, has anyone else picked this up yet?”

You can literally copy and paste this if you’d like, I wont tell. ;)

If someone has claimed the ticket but there hasn’t been any progress on the issue, still go ahead and make a comment asking if that person was still planning to work on the issue.

Then when you get the go ahead that it’s free to work on, it’s yours, go for it, don’t look back.

Step 4 — Start working!

Fork the project

  1. Go to the repository and clone, SSH or HTTPS is fine, it really just depends on your local set up.
  2. Open your terminal in a root directory, like Desktop or something fancy.
  3. git clone link-to-repo
  4. Then CD or change directory into path/to/directory
  5. YOU’RE IN!

Add upstream to your git remote

Why? So here’s the deal, big fancy Open Source projects won’t let you push directly to their projects….harsh, i know. There’s a way around this...shhhhhhh

  1. You’ll need to change your local git remote to reference the upstream fork so that you can rebase or merge when code changes in the main repository. This should help you set that up.

Make a branch

  1. git checkout -b your-branch-nameMore on this

Update your local environment to make sure its up to date with the parent repo

Why? People are going to keep merging in pull requests into the repo while you’re working. To make sure you have the latest changes in the main repository, do the following:

  1. git rebase upstream/master or git merge upstream/master

Do work! Add Your Changes! Commit your changes! Push your work!

  1. Add and commit your changes using git add . and git commit -m 'your message'.
  2. git push origin your-branch-name
  3. Go to your fork, and open a pull request. You will need to open the pull request from your fork against the main repo like so. Instead of sstern:master it’ll be the name of your branch awesome-reader-of-scotts-blog:your-branch-name.

Step 5 — Get Stuck?

Most Open Source projects will have a gitter, discord or slack channel for questions. Go to the chat and ask your questions and someone will unblock you. You can usually find the url to these in the projects README.

If this is not the case, find someone active on the repo you see commenting on issues and Pull/Merge Requests and message them directly, I’m sure they’ll be happy to help.

Hope you learned something!

Scott

Posted on by:

scottstern06 profile

Scott

@scottstern06

Frontend Engineer / You have problem, I contribute upstream(JS && OSS)

Discussion

markdown guide