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

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

Top comments (0)

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay