Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to clone/download code from a pull request

Tags:

git

github

I found a source code in github. It has some pull request which indicates the changing code. I would like to download/clone one of them to my PC. Its pull request id is 3983 at the address https://github.com/BVLC/caffe/pull/3983 Thank all

like image 534
John Avatar asked Dec 18 '22 09:12

John


1 Answers

Because, someone has more one pull request, each pull request has own ID. How can I download correct version which corresponds to pull request ID

It is better to clone the original repo, and import the PR branch based on its ID

git clone https://github.com/BVLC/caffe
cd caffe
git remote add christianpayer https://github.com/christianpayer/caffe.git

Then, for one of christianpayer's merged PR into origin:

git fetch origin pull/3983/head:pull_3983
git checkout pull_3983

You can fetch other PRs from that remote repo, or add other remote repos for fetching other PRs.

like image 196
VonC Avatar answered Jan 02 '23 05:01

VonC