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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With