How To Start Open Source Contribution

Why senior folks always focus on open source contribution, there might be some benefit right. Yes there is. Open Source Contribution can really change your thinking to read the code which is written by others 😁 (as I guess this is the most difficult task for a developer). Jokes apart there are a lot of benefit of open source contribution i.e You start reading other codes which help you to know how other writes code. You will get a chance to learn multiple new things which used in that project.

This article is not about what are the benefits of OSC but how to start Open source contribution. If you want to start open source contribution then this is the best article to start with. In This article I have added a step by step guide on how to start your open source contribution journey

You can follow me on Instagram for more such contents

https://www.instagram.com/thesmartcoders

Step 1: Understand What Open Source Is

Before contributing, it’s important to understand what open-source software (OSS) is. Open-source software is software that is freely available for anyone to use, modify, and distribute. Projects like Linux, JMeter, Kafka, Kubernetes, and Spring Boot are examples of open-source software.

You can read more about open source at the https://www.youtube.com/watch?v=SXW_bA4SGqA


Step 2: Learn the Basics of Git and GitHub

Most open-source contributions are made using Git and GitHub (or similar platforms). So You should have a solid understanding of:

  • Git: The version control system used to track changes in code.
  • GitHub: The platform that hosts repositories where open-source projects live.

Here are some resources to get started:


Step 3: Choose the Right Project

It’s essential to find a project that matches your interests and skills. And most importantly that project have some issues which are open and simple. As you are fresher so don’t directly start solving complex issues. You will waste your time only. Here’s how you can find the project under your interests:


Step 4: Understand the Project

Once you’ve found a project, you need to get familiar with it:

  • Read the README: The README file will give you an overview of the project, its purpose, and how to use it.
  • Check the contributing guidelines: Look for a CONTRIBUTING.md file which outlines how you can contribute.
  • Understand the issues: Look at the project’s issue tracker (on GitHub, it’s under the “Issues” tab). Many projects label issues with tags like good first issue, beginner-friendly, or help wanted.

Here’s an example of a contributing guideline from Spring Boot: Spring Boot Contributing Guide.


Step 5: Fork the Repository

Forking means making a copy of the repository under your own GitHub account. So you should also have a git hub account and git bash installed in your system. You will work on this fork, and later request to merge your changes into the original project.

  • On GitHub, navigate to the repository and click the Fork button in the top-right corner.
  • This creates a copy of the repository in your GitHub account.

    Image showing how to fork the existing github repo

Step 6: Clone the Forked Repository Locally

To start working on the project, clone the repository to your local machine:

git clone <https://github.com/YOUR-USERNAME/PROJECT-NAME.git>

Replace YOUR-USERNAME with your GitHub username and PROJECT-NAME with the name of the project.

if you are new to github then must check out this video : https://www.youtube.com/watch?v=Ez8F0nW6S-w&t=2670s


Step 7: Set Up the Development Environment

Follow the instructions in the project’s README or CONTRIBUTING.md to set up the project on your local machine. This could involve:

  • Installing dependencies (e.g., npm install, mvn install).
  • Setting up a development environment (e.g., IDE, Docker).

Step 8: Create a Branch

Before making any changes, create a new branch. A branch allows you to work on your changes separately from the main codebase:

git checkout -b my-feature-branch

The name my-feature-branch can be anything that describes the feature or bug you are working on.


Step 9: Start Working on the Issue

You’re now ready to start making changes. Make sure your changes:

  • Address the issue or enhancement you’re working on.
  • Follow the coding standards of the project (many projects use prettier or checkstyle for code formatting).
  • Include tests if necessary.

Step 10: Commit and Push Your Changes

Once you’re happy with your changes, commit them:

git add .
git commit -m "Fixes [issue-number]: Brief description of the change"

Make sure to reference the issue number in the commit message if applicable.

Push the changes to your GitHub fork:

git push origin my-feature-branch

Step 11: Submit a Pull Request (PR)

Now that your changes are pushed, you can submit a pull request to the original repository:

  1. Go to the repository you forked.
  2. Click New Pull Request.
  3. Select your forked branch (my-feature-branch) as the “compare” branch and the project’s main branch as the “base” branch.
  4. Provide a clear description of what your changes do, linking any related issues.

GitHub documentation on pull requests: About Pull Requests.


Step 12: Respond to Feedback

Once your pull request is submitted, project maintainers may review your code and request changes. Be open to feedback and iterate on your pull request:

  • Implement requested changes.
  • Update your pull request with the new changes (git push will automatically update the PR).

Step 13: Celebrate Your First Contribution

Once your PR is merged, you’ve officially contributed to an open-source project! 🎉


Step 14: Continue Contributing

  • Look for more issues to work on.
  • Get involved in discussions and contribute in other ways, such as improving documentation or helping others in the project’s community.

Helpful Tools and Resources

  • GitKraken: A graphical Git client to manage repositories (GitKraken).
  • Sourcetree: Another Git GUI for simplifying version control (Sourcetree).
  • Gitter: A chat and networking platform for developers contributing to open source (Gitter).

Final Tips for Newbies

  • Start small by contributing to documentation or fixing minor bugs.
  • Don’t be afraid to ask questions; open-source communities are usually friendly and supportive.
  • Keep contributing regularly to build experience and confidence.

Free Videos For Open Source Contribution

I hope this article helped you to do your first Open Source Contribution. Let me know in the comment if you have any query regarding this article or any things which mentioned in this article. I would be happy to help you.

Leave a Reply

Your email address will not be published. Required fields are marked *