How to Test a Pull Request Locally Before Merging.

undefined or mostly null.
Search for a command to run...

undefined or mostly null.
People, my budget is tight, and my coffee machine broke in the morning. That’s sad, but I can’t afford anything expensive. Is there a coffee maker under $100 worth attention? https://coffeelikeapro.com/gear/best-coffee-maker-under-100
In this series, I will share articles related to creating, contributing to, maintaining, and sustaining open source projects.
This little guide demonstrates how to turn any Github repository with a bunch of Markdown files into a simple website using Github Pages and Jekyll. You don't need to use the command line or anything other than your browser. It doesn't require any k...
I wrote this article in December 2023 for an interview screening task and thought to share it today while clearing my drafts for some new content prep, just in case it's still helpful to someone out t

Hey! I’m super excited to announce that I have joined the Secretariat Team at the Digital Public Goods Alliance. In this role, I leverage my passion for open source and technical background to assess DPG applications, provide technical support and ad...

Creative designs have become more important than ever in the software ecosystem today with many industries and end-consumers having several use cases that require them to offer design editing solutions to either designers or end-consumers. Every busi...

With the rise of artificial intelligence (AI) and large language models (LLMs), it has become easier to solve different human problems than ever before. Even consumers with little to no technical expertise can benefit from AI. Humans can now automate...

Some years ago, GitHub introduced the new Profile README feature that allowed GitHub users to pin a markdown file on their profile using a special repository named after their GitHub username. Since then, developers have used this file as a quick por...

So your repository got a new Pull Request?, You don't want to merge it before testing it out yourself locally on your machine. How do you go about it?
The pull request is available on this git ref pull/{ID}/head which you can
fetch using this, where ID is the pull request id. In this tutorial, I would show you how to check, test, and make changes to a pull request before merging.
Make sure you have a cloned version of the repository on your machine, Check here to learn how to clone repositories from GitHub.
Have your cloned Repository integrated into your IDE preferably Visual Studio Code [In this tutorial, I used VsCode]
Be conversant with git commands
Go to your repository folder
Initialize git (you can do that by right-clicking in the root folder)
Ensure your work tree is clean (you can do that by running git status)
Run the following commands to FETCH the pull request from GitHub where ID is the pull request's ID
git fetch origin pull/ID/head && git checkout FETCH_HEAD
Or, if you only want to cherry pick it, instead of checking it out, you can use
git fetch origin pull/ID/head && git cherry-pick FETCH_HEAD
What you have now is the contents of the pull requests and not your master branch, run your checks and tests to determine if the pull request is worth merging.
At this point, you can do anything you want with this branch. You can run some
local tests, or merge other branches into it, including master. Make
modifications as you see fit!
Once satisfied git checkout master to return to the master branch.
You can also make changes to the pull request and push it back to GitHub as a new commit or pull request.
After making your changes:
git add --all
git commit -m "Modified PR"
git push origin BRANCHNAME (e.g master or test)
That's it, you have tested the pull request and made changes!
If this article helped you, please share!