Github convert existing repo to a fork

跟風遠走 提交于 2020-03-02 19:32:26

问题


My organisation has a main repo called org/A.git. I forked it as me/A.git to Github first. My organisation admin made org/A.git private, which broke the fork. He then changed settings which would allow forking private repositories. me/A.git is still not a fork but a simple clone. How can I make me/A.git a fork again, without having to:

  1. Fork org/A.git again which would result in me/A-1.git.
  2. Delete me/A.git.
  3. Rename me/A-1.git to me/A.git.
  4. Push local changes to the new me/A.git.

I want to avoid the above 4 steps because I have additional contributors as well as branches in the original me/A.git and taking care of all that is just cumbersome for something which seems to be so simple.


回答1:


This is very, very, very old... However, I recently faced a similar circumstance myself, and contacted GitHub Support. For me, it wasn't that it was a fork originally and then it was broken, but rather I created my own repo manually before understanding what a fork was (still new to Git). GitHub Support confirmed there was no way to do it, unfortunately.

The quote from them:

Thanks for reaching out! Sorry for the trouble, but it isn't possible to attach a repository as a fork of another in this kind of situation -- repositories can't move from one fork network to another, or to a network they were not originally created from.




回答2:


I don't think you can. But the four steps you describe probably take less time than the time it took to post here. :-)

For step 4, how about git push --all origin?



来源:https://stackoverflow.com/questions/54660304/github-convert-existing-repo-to-a-fork

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!