Add fetching a GitHub PR ref directly (#129)

This commit is contained in:
Tom V 2017-11-12 13:10:33 +00:00 committed by Richard Littauer
parent e2ddb7fe55
commit 103e920531
1 changed files with 6 additions and 2 deletions

View File

@ -904,9 +904,13 @@ Your tag should now have been restored.
<a name="deleted-patch"></a>
### 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