0

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?

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
  • 1
    Are they working from a fork? If it's the same repo, you can just pull then checkout their branch same as any other. Or see https://stackoverflow.com/q/27567846/3001761. – jonrsharpe May 06 '22 at 18:52

1 Answers1

0

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)