简体   繁体   中英

How to checkout particular pull request

I successfully cloned a git repo

git clone https://github.com/vimalavinisha/angular2-google-chart.git

Now I want to checkout a particular commit from this pull request .

Here I can get the hash of the commit

https://github.com/vimalavinisha/angular2-google-chart/tree/3536be35189b0ea9b98633a3e2abb29796727865

or, the same,

https://github.com/vimalavinisha/angular2-google-chart/pull/16/commits/3536be35189b0ea9b98633a3e2abb29796727865

How do I checkout this commit? This command fails:

git checkout 3536be35189b0ea9b98633a3e2abb29796727865
fatal: reference is not a tree: 3536be35189b0ea9b98633a3e2abb29796727865

That is simple:

git fetch origin refs/pull/16/head
git checkout 3536be35189b0ea9b98633a3e2abb29796727865

You can get the number of pull request from the url:

https://github.com/vimalavinisha/angular2-google-chart/pull/16/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM