Making Your First Open-source Contribution: A Beginner's Guide

SERIES: The Beginners Guide to Hacktoberfest

Posted on: Sep 22, 2023

4 mins read

Making Your First Open-source Contribution: A Beginner's Guide

It takes a lot of people to make a winning team. Everybody's contribution is important. ~ Gary David Goldberg

Welcome back to our journey into the world of open source and Hacktoberfest! By now, you should be well-versed in the fundamentals of open source and ready to take your first steps as a contributor. 🚀

In this article, we'll dive into the nitty-gritty of making your very first open-source contribution. We'll use a practice repository called Open-source Practice Repo to demonstrate every step. So, let's get started on your path to becoming a bona fide open-source contributor.

Important:

For this example, I will show you how to contribute via the GitHub web interface. However, you can also make contributions via the command line. Check out the readme of this practice repository for more information. And the video in the Resources section.

Steps to Making your first open-source contribution

Step 1: Forking a repository

The first step is to fork the open-source project's repository. Forking creates a personal copy of the project where you can make changes without affecting the original project.

  • Visit the project's GitHub repository. (I am using Open-source Practice Repo.)
  • Click the Fork button in the upper right corner and fill in the details.
  • You'll now have your copy of the project in your GitHub account.

How to fork a GitHub repo

How to fork a GitHub repo

Step 2: Creating a branch

Before you start making changes, it's good practice to create a new branch. This isolates your work from the main project and makes it easier to manage your contributions.

  • Navigate to your forked repository.
  • Click the Branch button.
  • Click the New branch button and enter a name for your branch.
  • Give your branch a descriptive name, e.g., feature/add-my-name.

How to create a new branch

How to create a new branch

Step 3: Making changes

Here comes the exciting part! You can now make changes to the project in your branch. It could be anything from fixing a bug to adding a feature. For this example, we'll add our name to the list of contributors.

  • Navigate to the branch you created earlier.
  • Look for the contributors folder in the root directory and click on it.
  • Click on the names.md file.
  • Click the Edit button.

How to edit a file on GitHub

How to edit a file on GitHub
  • Add your name to the list of contributors.
  • Click Commit changes.
  • Enter a descriptive commit message.
  • Click Commit changes.

How to commit changes on GitHub How to commit changes on GitHub

How to commit changes on GitHub

Step 4: Submitting a Pull Request (PR)

Once you're satisfied with your changes, it's time to submit a Pull Request to the original project. This is how you propose your changes for inclusion.

  • Go to your forked repository on GitHub.
  • Click on the Pull Request tab.
  • Click New Pull Request. (You might also see a Compare & pull request button.)

submiting a pull request

submiting a pull request
  • Select the branch you created earlier.
  • Describe your changes and why they should be merged.
  • Click Create Pull Request.

How to submit a pull request on GitHub

How to submit a pull request on GitHub

Step 5: Celebrate!

Congratulations! You've just made your first open-source contribution. 🎉 All that's left to do is wait for the project maintainer to review your changes and merge them into the project.

Open-source projects to explore

As promised in the previous article, here are some other beginner-friendly open-source projects to practice with. Feel free to fork them and make your contributions.

You can also use these platforms to find more open-source projects to contribute to:

Conclusion

In the following article, we'll examine some of the best practices for making open-source contributions. Like writing good commit messages and making your code readable. So, stay tuned for that.

Remember, every contribution counts, no matter how big or small. Your journey to open-source greatness has just begun! 🌟🌐

If you have any questions or comments, don't hesitate to contact me on X (Twitter). I'd love to hear from you. 😊 Also, don't forget to share this article with your friends and colleagues. See you in the next one!

Man smiling and waving goodbye
Image from giphy.com

Connect With Me

Follow me on X(Twitter), and LinkedIn to stay updated with my latest content.

If you like my notes and want to support me, you can sponsor me on GitHub Sponsor, or you can buy me a virtual ice cream on ByMeACoffee or Selar. I would really appreciate it. 🙏

For other ways to support me, visit my Sponsorship page or Affiliate Links page.

Simplify your workflow with free, ready-to-use Notion templates!

Subscribe to my newsletter 💌

Stay in the loop on the latest articles, tutorials, projects, and exclusive content focused on web development! 💻📚✨