From 103e9205310a491e06087a3940e6c4adc756d8c7 Mon Sep 17 00:00:00 2001 From: Tom V Date: Sun, 12 Nov 2017 13:10:33 +0000 Subject: [PATCH] Add fetching a GitHub PR ref directly (#129) --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5ad2117b..aa1071b9 100644 --- a/README.md +++ b/README.md @@ -904,9 +904,13 @@ Your tag should now have been restored. ### Deleted Patch -If someone has sent you a pull request on GitHub, but then deleted their original fork, you will be unable to clone their commits or to use `git am`. In such cases, it is best to manually look at their commits and copy them into a new branch on your local. Then, commit. +If someone has sent you a pull request on GitHub, but then deleted their original fork, you will be unable to clone their repository or to use `git am` as the [.diff, .patch](https://github.com/blog/967-github-secrets) urls become unavailable. But you can checkout the PR itself using [GitHub's special refs](https://gist.github.com/piscisaureus/3342247). To fetch the content of PR#1 into a new branch called pr_1: -After committing, change the author of the previous commit. To do this, see how to [change author](#commit-wrong-author). Then, apply whatever changes needed on to, and make a new pull request. +```sh +$ git fetch origin refs/pull/1/head:pr_1 +From github.com:foo/bar + * [new ref] refs/pull/1/head -> pr_1 +``` ## Tracking Files