DEV Community

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

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay