Reputation: 34423
There is one open PR on GitHub which was not accepted into to official repository. I would like to merge this PR into my fork. It seems the forked repository which the PR was made from was deleted meanwhile. I am able to get the complete change data from the PR as a patch file, but there is one information I am missing so that I can apply it: which commit should the patch apply to? I was trying various points in the repository history, but there were always a few "hunks" which could not be applied.
The PR I am talking about is Flying Saucer PR #22, the patch file can be obtained by appending .patch to the URL (thanks Download Github pull request as unified diff to describing this).
Is there a way to get the commit hash or some other identification of the point in the target repository history against which the PR was made, or some other way to merge such inactive and abandoned PR into my own fork?
Upvotes: 4
Views: 282
Reputation: 34423
After some more searching I was able to find documentation describing how to deal with inactive PRs -Modifying an inactive pull request locally:
Find the ID number of the inactive pull request. This is the sequence of digits right after the pull request's title.
Open Git Bash.
Fetch the reference to the pull request based on its ID number, creating a new branch in the process.
git fetch origin pull/ID/head:BRANCHNAME
Switch to the new branch that's based on this pull request:
[master] $
git checkout BRANCHNAME
Switched to a new branch 'BRANCHNAME'
The only difference for me was to not fetch from origin
(which is my own fork), but rather from upstream
(which I have configured to point to the main repository).
Upvotes: 2