Skip to content

Commit

Permalink
Add fetching a GitHub PR ref directly (k88hudson#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomviner authored and RichardLitt committed Nov 12, 2017
1 parent e2ddb7f commit 103e920
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 103e920

Please sign in to comment.