'Pulling another dev's PR to my local machine
A dev on my team made a PR to merge his changes from his branch to our "develop" branch.
I want to run his changes to our code on my machine, since I have to write tests for his changes, but I don't get how to do that.
I currently have the "develop" branch for the repo "webapp" on my local machine. When I run git branch it shows up as * develop.
How do I pull his branch to my local machine so I can run the tests?
Solution 1:[1]
If you want to pull the changes into your branch (commit them): git pull origin pull/939/head (Note: 939 should be substituted for the PR number)
If you want to pull the changes into a new branch (because you may be working on some other changes in the same service you don't want to override):
git fetch origin pull/939/head:develop (Note: 939 is the PR number)
git checkout myNewBranch (Note: myNewBranch is the new branch name you will give for his work you are running on your machine)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
