Congratulations! You've picked an open source project to contribute to and you're ready to start making a difference(Need a refresher? Check out this and that previous post.)! But before we can celebrate, you'll need to learn about one of the most essential tools in your open source contributor's toolkit: the pull request! So grab a snack and open that Google Doc (or whatever word-processing software you use), because
Before I let you go and be "pull request happy", let's define what a pull request is. It's when you add your suggestion to an open source project via a line of code.
Think of it as a software development version of putting your comments onto a shared Google Doc or presentation for a group project for school. It's essential in the open source contribution process because your line of code impacts how the project functions. Now that's settled, on to making your first pull request!
Now there are so many methods to making a PR(these are the initials for pull requests), but here are steps that I find helpful.
- Fork the project's repository
Make your desired changes to the code or documentation
Click on Commit Changes
- Add your message in the commit message textbox, pick the Create a new branch for this commit and start a pull request option, and click on Propose changes.
- Go to the projects repository and click on Compare & Pull Request
- Describe your changes in the pull request form, click on Create Pull Request , and wait for feedback from the projects maintainers
Congratulations, you're now a pull request pro! But before you start PR-bombing every open source project out there, let's cover some best practices to make sure your contributions are effective and appreciated by the project maintainers. So, let's dive into some essential PR dos and don'ts!
Use a descriptive title that summarizes your changes.
Reference any relevant issue numbers in your pull request description.
Add screenshots or other visual aids to help explain your changes (if applicable).
Refer to the checklist shown on your pull request to ensure that you have completed all necessary steps.
Don't make overly large or complex pull requests: it's better to break changes down into smaller, more manageable chunks.
Don't make stylistic changes that are unrelated to the main purpose of the project.
Don't disregard any code formatting or style guidelines set by the project maintainers.
Don't forget to test your changes before submitting the pull request.
Congratulations, you're now a pull request pro, woohoo! Remember, making contributions to open source projects can be a fulfilling and rewarding experience. If you need a coding buddy or more inspiration, follow me on Hashnode and my other socials on Linkfree. May your contributions be bug-free and legendary.
3 2 1 Waiting GIF by Funimation
GitHub Pull Request Diagram by Crunchify
Level Up Glu GIF by Ground Level Up
Willow Smith GIF by Red Table Talk