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

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

ยท

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.

๐Ÿ’ก
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

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

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

  • 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

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

  • 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

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 drop them below. 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

Resources

Connect with me ๐Ÿ”—

Follow me on Twitter, LinkedIn, and Instagram to stay updated with my latest content.

If you like my notes and want to support me, you can buy me a coffee on ByMeACoffee. I love the taste of coffee. ๐Ÿ˜

For other ways to support me, visit my Sponsorship Page.

ย