A pull request is a bunch of commits forking for some other commit. As such, the same commits should be applicable to the forked repository (Solr or Lucene), at least initially (until the folder structure changes, for example).
Here is a sample workflow to apply an existing pull request from Lucene:
https://github.com/apache/lucene-solr/pull/2459
git clone https://github.com/apache/lucene.git cd lucene wget https://github.com/apache/lucene-solr/pull/2459.patch git apply 2459.patch git add -A . git commit -m "Applying PR # ..." git push
create a github fork of the lucene repository (mine at https://github.com/dweiss/lucene)
locate the source repository and branch of the PR. For our example: https://github.com/apache/lucene-solr/pull/2459 the source is: https://github.com/donnerpeter/lucene-solr/tree/revTrie
Now create a “cloned” PR:
# clone your own fork git clone https://github.com/dweiss/lucene.git cd lucene # add pr's repository as the remote and fetch commits from there git remote add donnerpeter https://github.com/donnerpeter/lucene-solr.git git fetch donnerpeter # get the PR's branch: git checkout donnerpeter/revTrie -b revTrie # push to your own fork git push origin HEAD -u # The above will display a PR-creating link but you can also do this manually: https://github.com/apache/lucene/compare/main...dweiss:revTrie Look at the PR and create it if it looks good. # This example's PR was at: https://github.com/apache/lucene/pull/2