21

I have the following scenario:

  • Created a fork of a github repository
  • Submitted a pull request (still opened)
  • Deleted the fork

Now, when I browse the opened PR on github, the repositories section says "unknown repository".

I want to revert my fork in order to make this section displaying its name.

My first idea was to re fork the upstream repository, rebase it properly (thank's to this one) and pray for that github automatically re-fill the correct name in the PR.

Unfortunately, nothing happened.

How can I achieve this ?
Should I contact support ?

Community
  • 1
  • 1
chalasr
  • 12,971
  • 4
  • 40
  • 82

3 Answers3

17

Unfortunately it looks like your pull-request will remain an orphan.

See this (still unresolved) thread: https://github.com/isaacs/github/issues/168

Probably the best thing to do would be to re-clone the repo, re-create your pull-request, delete the existing pull-request, and submit a fresh one.

Also, add a "thumbs up" to tohe issue so in the future there can be a more straight-forward solution to this problem.

ashawley
  • 4,195
  • 1
  • 27
  • 40
Tracysss
  • 584
  • 4
  • 8
  • 1
    Hi @Tracyss, thank's for your answer. I already re forked the repo, cloned it and checked out my PR's commit, but I can't (and don't want) re-submit the PR. There is a lot of conversation, line notes and so on that involves I don't want to close it. Thx for the issue, I added a comment into. I will try to "contact a human" and I hope they can rebuild the exact fork and reattach it to the PR. If nobody can help me, I'll accept your answer in some days. – chalasr Mar 18 '16 at 10:32
17

You can reclaim orphaned pull requests as

git fetch <remote> refs/pull/<pr_number>/head:<local-branch>

git checkout <local-branch>
Ronn Macc
  • 1,271
  • 9
  • 7
  • Could you please additional information on this as it didn't work for me. When I pushed changes after doing the above, it create commits on my fork just like new commits and didn't at all connect the old PR with my commits. – PrivateOmega Jan 26 '20 at 13:34
  • In this case, the PR (orphaned) branch is owned by the admin. Technically you got ReadOnly access to it. You could get the admin to push more commits to the existing PR. Or raise another PR (from your fork). In this case, you lose all the comments and reviews etc, but the main purpose of salvaging the code is served. – Ronn Macc Jan 31 '20 at 14:43
  • Thanks, that sounds fine. – PrivateOmega Jan 31 '20 at 14:48
-1

If your pull request is open from long time, then repository will show "Unknown repository". So, close previous open pull request/ or do again pull request for previous change. Then you can see your name for latest pull request.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
sneha
  • 107
  • 1
  • 2