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

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

Timonwa Akintokun Timonwa Akintokun

4 min read


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 on GitHub
How to create a new branch on GitHub

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
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 on GitHub
Submiting a pull request on GitHub
  • 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!


If this article helped you, it might help someone else too. Click the share button below to spread the word!
Got thoughts or questions? Lets connect on X or LinkedIn.
Till next time, happy coding! 😊

Man waving goodbye


Enjoyed this article?

Be the first to get new blog posts, tutorials, and developer productivity tips delivered to your inbox.

More posts in open source