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 thename of source branch
in the pull request (say it isrenovate/prisma-monorepo
) -
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
-
Easy to follow and simpler
-
Hard to follow and complex
Top comments (0)