How to Create Small Yet Powerful Pull Requests
Tags: opensource, github
Published: 2023-12-12 13:00:00

## Dispelling Rumors 
A common belief that fairly new open source contributors tend to have is the bigger the pull request, the better. Well, contrary to this belief, bigger is not always better. Sometimes, doing small pull requests to solve an issue, especially ones that are large, is actually better.   Feel intimidated? Don’t fret. In this blog post, I will share 5 tips to create effective small pull requests.  

## Tip #1: Read the issue closely
Whether you’re  fixing a bug, or revising outdated tutorials, it’s important to thoroughly read the project’s issue because it’s where you’ll find the problem that needs solving. For example, during the ending week of Hacktoberfest, I stumbled upon the following issue at @yuridevat's project, Yuri’s Coding Club’s Accessibility Mentor:
 {% github https://github.com/YurisCodingClub/accessibility-mentor/issues/47 %} 
 I thought it was going to be easy, but then as I read the issue more deeply, I realized that there were specific requirements such as:

- Update the content of the `doc.yml` file
- Update the content of the `feature.yml` file

At first, I had no idea how to go about fixing this issue.  But after taking a deep breath, I decided to create small Pull Requests for each section, so I proposed this idea to the project’s maintainer. After she approved my idea, the question I had then was “Which one should I do first?". This is where the tasklist comes in.

## Tip #2: Create a tasklist 
Like most things in life, a checklist is needed for taking on big tasks and pull requests are no exception. Here’s how it looks:

![tasklist for issue template form](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wlp4erm01q30vdb507t1.png)
Adding this to your Pull Request will help you stay focused as you create your contribution.  For example, I clicked on the tasklist, and created a PR form for the `docs.yml` file.   Here's how it looks:

![Tasklist on the docs.yml file PR](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/utfkcnpryv0wuz94iw84.png)
After that, I repeated this process for the `feature.yml` file:

![feature.yml file on tasklist](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/27qbxt05ssd4x5oaswdk.png)

![Pull Request for feature.yml file](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e2u0z21f8exq0ib2eqdu.png)
If you want to learn more about tasklists, check out the article, “[Creating a tasklist](https://docs.github.com/en/issues/managing-your-tasks-with-tasklists/creating-a-tasklist)”.  Now, creating a tasklist is only one of the many ways to make effective small Pull Requests. Let’s move onto the next tip.

## Tip #3: Link the small Pull Request to its corresponding issue 

You know how Mufasa from _The Lion King_ says, “We are all connected in the Circle of Life”? Well, the same concept applies to open source. Small pull requests and their issues are no different. Linking the small pull requests to their corresponding issues makes it easier for maintainers to understand how your contribution would help improve or solve a problem in their project.
 After making my Pull requests for each yml file, I went to the **Fixes Issues** section of each PR form and did the following: 

![Screenshot of docs.yml file PR focuses on the Fixes Issue section](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gpkcfzb0nte1td4trk1x.png)
I used specific keywords like “closes” because it ensures that its corresponding issue and checkbox in the main issue form’s tasklist will automatically close: 
![main issue closed](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wt5tis7rxh4439twuy8c.png)

## Tip #4: Create separate branches 
As a general open source rule, it’s always best to create separate branches to make Pull Requests. This however, is especially important when creating smaller Pull Requests. For example, I named the branch for my PR for the docs.yml file “revise-docs.yml-file” and “fixing-the-feature.yml-file” for the branch for my  feature.yml file PR. As simple as these names are, doing this makes it easier for me and the project’s maintainer to keep track of how the problem is being addressed. Now before you go and start creating small Pull Requests, there’s just one more tip I have for you.  

## Tip #5: Write specific instructions for merging 
Managing the merging process of pull requests is like traffic lights controlling cars and other vehicles. If too many go at once, casualties and accidents occur (or in the case of open source, merge conflicts).  To prevent issues like this from happening, it helps to specify when to merge certain pull requests. For example, I put the question “Hi [Maintainer’s name], can you merge this one first before you do the other one?" in the comment section of my PR for the docs.yml file. Doing this not only fosters effective communication but ultimately makes the merging process smoother.   

There you have it folks! Five tips on how to create small yet effective pull requests. Doing this would not only help you grow in your open source journey, but prepare you for your tech role. Speaking of journey, if you’re looking for more ways to get started in open source or need a refresher, check out our [intro course](https://intro.opensauced.pizza/#/). Need more practice? Check out these issues in our [pizza-verse repository](https://github.com/open-sauced/pizza-verse/issues). Also, join our [Discord](https://discord.com/invite/U2peSNf23P) community to learn about other projects to contribute to. We look forward to working with you! 😊