I'm looking for a way to recover pull requests from a forked repository. Is it possible?
When one fork a repository, GitHub only forks the code, not the pull requests.
However, you can retrieve the pull requests from the upstream repository by leveraging the GitHub Pull Request API .
By default, only the PR which are currently opened are listed. You can access the closed ones by passing an optional state parameter.
Note: This will allow you to retrieve the metatdata of the pull requests of any repository (forked or not).
Alternative (by hand) way
$ mkdir libgit2
$ git clone http://github.com/libgit2/libgit2
$ git fetch origin +refs/pull/*:refs/remotes/pull/*
This will retrieve every pull request ( opened and closed ) from the GitHub hosted repository and create a branch per pull request in you local repository.
Warning: this is an undocumented GitHub feature and might stop working without notice.
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.