TWIL
git
Illustration of Marisa demonstrating the process of Checking Out Pull Requests from Forked Remotes in Git, symbolizing the swift integration of important updates into a project's workflow.

Welcome to another installment of TWIL, the weekly knowledge boost from Cuttlesoft where we showcase the practical insights our team members discover. In this week’s edition, Marisa offers a clear guide on how to Checkout Pull Requests from Forked Remotes in Git. Learn the step-by-step process to incorporate changes swiftly, even before they're merged upstream—perfect for times when updates can't wait.

Checkout pull request from forked remote

Say you have a library you are using, and there's an issue with it. A fix has been pull-requested, but it hasn't been merged in. We should:

  1. Fork the library
  2. Set the upstream
  3. Checkout the PR locally
  4. Push up our branch
  5. Set the source for the library as our forked branch

Fork the library for Cuttlesoft

git clone <cuttlesoft-library-url>
git remote add upstream <library-url>
git fetch upstream pull/<PR-ID>/head:<new-branch-name>
git checkout <new-branch-name>
git push origin <new-branch-name>

Get the url for the commit pushed up to our Cuttlesoft fork, it should look like:

https://github.com/cuttlesoft/<library-name>#<commit-hash>

Update your package.json with the url like so:

"<library-name>": "https://github.com/cuttlesoft/<library-name>#<commit-hash>",

Make sure you yarn install or npm i and you should be good to go!

  • Git
Marisa Gomez's profile picture
Marisa Gomez

Senior Software Engineer

Related Posts

August 18, 2024 • Frank Valcarcel

What makes Enterprise Software Development Different?

Enterprise software powers large organizations, handling complex tasks across departments. From robust security to scalability, these solutions face unique challenges. Explore what makes software “enterprise-ready” and how to choose the right development approach for your business.

Cuttlesoft's leadership team in a software design and planning meeting at our Denver headquarters
December 21, 2019 • Frank Valcarcel

Cuttlesoft Ranked a 5-Star Agency!

Cuttlesoft achieves levels of flexibility and efficiency that set us apart from the competition. Which is why our 5-star ranking on Clutch, a premier B2B buying guide, shows we can deliver.