How do You contribute to Open Source? Everything You Need to Know

How do You contribute to Open Source? Everything You Need to Know

Steps to Making Your First Open Source Contribution

Why This Blog? πŸŽ‰

Open source is a fantastic opportunity for students and beginners who want to:

  • Work on industry-level projects. πŸ’»

  • Gain experience equivalent to a developerβ€”all while in college. πŸŽ“

  • Build confidence and skills that can help them stand out among the crowd and secure future opportunities. πŸš€

This blog will guide you step-by-step on how to contribute to open source, from finding the right project to submitting your first pull request (PR), which is making your first contribution 😁. πŸ› οΈ

What Will You Learn? πŸ“š

By the end of this blog, you’ll know:

  • How to find an open-source project that fits your skills and interests. πŸ”

  • The best way to discover beginner-friendly issues. 🌟

  • How to request assignments from the code maintainers. πŸ“©

  • The common procedure to download a copy of the industry-level code on your computer. πŸ’Ύ

  • How to submit a pull request and wait for the code maintainers to review and add your code to their code-base. ⏳


Step 1: Finding the Right Open-Source Project 🧐

Where to Start? πŸš€

It takes patience to find a project that matches your tech stack, but don’t worry! Here are some excellent platforms I gathered for you to explore (below underlined texts are links to the websites πŸ˜€):

In the above links, you can filter out many open sources with the programming language that you desire. πŸ—‚οΈ

Choose an active project where maintainers regularly update the code, fix bugs, and add features. Projects with recent commits and open issues are good to go since they might have more beginner-friendly issues. πŸ› οΈ

My three golden rules ✨

While every open source project has its own definition and use cases, it is important to choose an open source that is not idle and is active regularly (on a daily or weekly basis). πŸ”„

You’ll be able to understand the below points if you already know about GitHub and open source projects. If not, I kindly request you to read this entire blog for much more clarity. πŸ“–

πŸ”‘ The golden rules are

  • The project should be actively updating its features and have a good number of issues listed in the issues section (we’ll see what we can do if there are fewer issues as well). πŸ“

  • There must be proper documentation of the project for you to read and understand how their project works. This may include their coding style, file management, code structure, etc. πŸ“š

  • There must be a forum or community to reach out to the code maintainers to clarify any details about the code. This helps you improve your networking ability as well as make it easier to get some help as quickly as possible. 🀝

    • If you have reached out to the code maintainers and they couldn’t get back to you, you can just give them a kind reminder since they might have a busier schedule in which your message might have gotten lost. πŸ“¬

Step 2: Getting the Code on Your Computer πŸ’»

After finding your ideal project, you need to know how to get the code onto your computer. Let's look at how to do this. In this blog, I'll use the open source project called Mathesar, which I have been contributing to, as an example to explain the process.

For any open source project, you can find the link to their project's GitHub repository (some open source organisations do not use Github but some other version control service providers) on their website or in their documentation. Go to their GitHub repository and fork their project. Forking is a process that you use to have a clone of their open source code in your GitHub account. πŸ”„

Next, you’ll be redirected to a page as shown below. πŸ‘‡

Now you can give any name you want as the β€œRepository name” field. And then click the β€œCreate Fork” button to get that codebase copy in your GitHub repository. πŸ—‚οΈ

After creating the fork, you'll see a screen showing that the code has been forked. On this screen, you need to copy a link by following these steps. Click the buttons in the order shown in the screenshot. πŸ“‹

Make sure you have copied the link. βœ…

Now let’s see how to download this code on your computer. This process is called β€œCloningβ€œ. πŸ–₯️

Head to your terminal/command prompt and paste that link as follows. πŸ’»

git clone the-link-that-you-copied

After running the command, you'll see the following lines in your terminal/command prompt. The project will be cloned into a directory named after the .git name you cloned from. In this case, it is mathesar. πŸ“‚

Now that you have the code cloned on your computer, open it in any code editor that you prefer.

Before you start making any changes to the code, it's crucial to ensure that you are working on a separate branch. This helps keep your modifications organised and prevents conflicts with the main codebase. Begin by creating a new branch from the most recent version of the updated code branch. To do this, open your terminal or command prompt and navigate to the directory where your project is located. Once there, use the following command to create and switch to a new branch:

git checkout -b your-new-branch-name

Replace your-new-branch-name with a descriptive name that reflects the purpose of your changes, such as feature-update or bugfix-issue123. This practice not only helps in keeping your work tidy but also makes it easier for others to understand the context of your changes when you eventually push your branch to the remote repository for review or collaboration. Working on a new branch ensures that the main branch remains stable and free from any unintended modifications while you develop and test your new features or fixes.

Step 3: Finding Issues to Work On πŸ› οΈ

How to Choose an Issue πŸ€”(link)

Look for issues labelled as good first issue or help wanted. These are beginner-friendly and often come with clear descriptions. πŸ“

If you find an issue you’d like to tackle, leave a comment to let the maintainers know you’re working on it. πŸ’¬

So how to do that? πŸ€”

  1. Firstly, go to the issues page of that project. πŸ“„

Then copy the below tags and paste them in the labels field, like mentioned in the below screenshot. 🏷️

is:open is:issue label:"good first issue"

After you press enter or click the πŸ”Ž button, you may or may not see any issues labelled as good first issues, or they might already be assigned to someone else. This can happen sometimes, as it has happened to me often, but I never stopped searching there. Similarly, you shouldn't stop looking for these issues. It's not necessary to only go for good first issues; if you find any other issues that you feel that you can solve, go ahead and try to solve them.

Don't lose hope on your first project, because there are hundreds of thousands of projects out there that might match your skills or interests. 🌍

Step 4: Reading the developer documentation of the project

This is an important step because the documentation will help you understand the coding style, project structure, and other key aspects needed for developing or contributing to the project. If you need help finding the developer documentation, you can definitely reach out to the project's community and ask for assistance. Remember, interacting with the community will help you improve your networking skills and expand your network. 🀝

Step 5: Making Changes in the code to solve the issueπŸ› οΈ

Once you've selected an issue and created a new branch, it's time to make the necessary changes to the code. Follow these steps to ensure your changes are effective and error-free:

  1. Understand the Issue: Before making any changes, make sure you fully understand the issue. Read through the issue description and any related documentation. If you have questions, don't hesitate to ask the maintainers or the community for clarification. 🧐

  2. Make Changes: Use your preferred code editor to make the necessary changes. Ensure that your code follows the project's coding style and guidelines. This will make it easier for maintainers to review and accept your changes. ✍️

  3. Test Your Changes: Before submitting your changes, test them thoroughly to ensure they work as expected and don't introduce new bugs. If the project has automated tests created and maintained by the maintainers, run them to verify your changes. πŸ§ͺ

Step 6: Submitting a Pull Request πŸ“¬

After making and testing your changes, it's time to submit a pull request (PR) to the original repository. Here's how to do it:

  1. Push Your Changes: First, push your changes to your forked repository on GitHub.

  2. Create a Pull Request: Go to the original repository on GitHub and click the "New Pull Request" button. Select your branch and provide a clear and concise description of the changes you've made. Include any relevant issue numbers and explain how your changes address the issue. πŸ“

    To create a PR (Pull Request), follow these steps:

    1. Go to the Pull Requests tab of the repository.

    2. Choose the branch that you created to solve the issue.

    3. Click on the β€œCreate Pull Requestβ€œ button to redirect to the PR editing page.

    4. Now, after entering the necessary details to create a PR, click on the "Create Pull Request" button.

  3. Wait for Review: Once you've submitted your PR, the maintainers will review your changes. Be patient, as this process can take some time. They may request changes or provide feedback, so be prepared to make adjustments if necessary. πŸ”„

The PR you created may require further improvements too, but it’s for the best of the organisation and your knowledge.

Once your PR is merged, you're unstoppable! πŸŽ‰πŸš€ You can dive right in and pick the issues you want to work on, creating a steady flow of PRs. πŸ˜‰

Step 7: Engaging with the Community 🀝

Contributing to open source is not just about writing code; it's also about being part of a community. Here are some ways to engage with the community:

  • Participate in Discussions: Join forums, mailing lists, or chat groups related to the project. Share your thoughts, ask questions, and learn from others. πŸ—£οΈ

  • Attend Events: Many open-source projects host events, such as hackathons or meetups. Attend these events to meet other contributors and learn more about the project. πŸŽ‰

  • Help Others: As you gain experience, help other newcomers by answering questions or reviewing their code. This not only strengthens the community but also enhances your own skills. 🌟

Conclusion 🎯

Contributing to open source is a rewarding experience that can help you grow as a developer and connect with a global community. By following these steps, you'll be well on your way to making meaningful contributions and building a strong foundation for your future career. Happy coding! πŸš€

Β