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.
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
.
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.
- Add your name to the list of contributors.
- Click Commit changes.
- Enter a descriptive commit message.
- Click Commit changes.
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.)
- Select the branch you created earlier.
- Describe your changes and why they should be merged.
- Click Create Pull Request.
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.
- Open-source Practice Repo
- Syknapse/Contribute-To-This-Project
- firstcontributions/first-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 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!
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 at ByMeACoffee. I love the taste of coffee. 😍
For other ways to support me, visit my Sponsorship Page.