Forem

Aashutosh Poudel
Aashutosh Poudel

Posted on

Test upstream PR changes locally [Github]

Steps to bring the changes made in a pull request into your local machine:

  • Find the id of pull request you want to test (say it is #2361) as well as the name of source branch in the pull request (say it is renovate/prisma-monorepo) PR id and branch name
  • When working on a fork of a upstream repo, git remote -v may look like this:

    origin  git@github.com:atosh502/chapter.git (fetch)
    origin  git@github.com:atosh502/chapter.git (push)
    upstream        https://github.com/freeCodeCamp/chapter.git (fetch)
    upstream        https://github.com/freeCodeCamp/chapter.git (push)
    
  • The PR is likely made against a branch(destination: main) in the upstream repo. In order to get the branch(source: renovate/prisma-monorepo) containing the changes for PR to the local repo use the following:

    # git fetch origin pull/<ID>/head:<BRANCH_NAME>
    git fetch upstream pull/2361/head:renovate/prisma-monorepo
    
  • After this the upstream branch from PR will be available as a local branch and we can test the changes.

Resources

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

Top comments (0)

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay