Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fix "unknown repository" of an opened PR after deleted the fork

Tags:

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 ?

like image 245
chalasr Avatar asked Mar 17 '16 20:03

chalasr


People also ask

What happens if forked repo is deleted?

Also note that if you are deleting a forked repository, deleting it will only remove it (including any changes you have made to it) from your own GitHub - you won't accidentally delete the original project (phew).

How do I recover a deleted pull request?

Restoring a deleted branchUnder your repository name, click Pull requests. Click Closed to see a list of closed pull requests. In the list of pull requests, click the pull request that's associated with the branch that you want to restore. Near the bottom of the pull request, click Restore branch.

Can I delete a forked repository and fork it again?

There will not be any harm deleting the forked repositories. You can again fork that. It won't change the original code.

Can I delete a forked repository after pull request?

As mentioned here, as long as your PR (Pull Requests) are accepted, you can delete your fork.


2 Answers

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.

like image 175
Tracysss Avatar answered Sep 23 '22 07:09

Tracysss


You can reclaim orphaned pull requests as

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

git checkout <local-branch>
like image 39
Ronn Macc Avatar answered Sep 25 '22 07:09

Ronn Macc