Reattach a "Detached" fork in Github?


I’m wondering if there is anyway to reattach a “detached” repository in GitHub?

Order of events:

  1. Forked a private repository from an organization I belong to
  2. Parent, private repository went public
  3. I made my forked repository public as well (or get billed)
  4. Now when I was hoping to submit a pull request and merge some changes, I noticed that my fork is “detached” from the parent repository (see this explanation and confirmation as to why)

Is there any hope of “reattaching” this fork? Or do I rename my repository, fork again, and copy over code?

Any suggestions welcome.


Thanks to @saeedgnu for the elegant and perfect suggestion. Solution was to:

  1. Make sure to pull and update local git repository from personal, detached fork GitHub repository
  2. Delete personal, detached fork GitHub repo
  3. Re-fork repository on GitHub
  4. The key: the local git repository is still pointing at the correct GitHub repo. It has the current code from your now-deleted, detached GitHub fork, so you can push changes (and continue to submit pull requests) like nothing ever happened!

Phew. Crisis averted.

Answered By – ghukill

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published