简体   繁体   中英

How to clone from a lost GitHub repository?

I would like to clone from the latest commit of the following Pull Request: https://github.com/jenkinsci/backend-update-center2/pull/17/commits

The trick is that this Pull Request was never merged and the repository containing the latest commits from jrichardBD is long gone.

The user ikedam (commit a5cac69 in the history) still has the respective fork, so if I clone from there (or add his repo as remote) I'm able to checkout everything up to his latest commit. The latest changes, however, are nowhere to be found because jrichardBD reset his fork with the upstream.

Interestingly, I still can "Browser the repository at this point in the history" and download from there. But if I clone it, I'm unable to checkout that commit:

$ git checkout b19336fcbb78a5c14075b09e31f944a68539b1af
fatal: reference is not a tree: b19336fcbb78a5c14075b09e31f944a68539b1af

Any ideas how to checkout this specific commit?

GitHub stores pull requests under

pull/ID/head

so you can fetch the pullrequest into a repair-pr branch using

git fetch git@github.com:jenkinsci/backend-update-center2.git pull/17/head:repair-pr
git checkout repair-pr

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