Home > OS >  Github - TA asked us to make our private repos public. I forked private repo as did another. The for
Github - TA asked us to make our private repos public. I forked private repo as did another. The for

Time:11-24

I got points removed because the TA couldn't access the private repo. At that point in time, the private repo I had forked showed forked from (insert team member here). At the request of the TA, he wanted the repos to be converted to public so that he could get access. We did as he said and the repos became public. I was later informed that the forked status got removed after the repos got made public. How should I fix the situation so that the repos could be public and show a forked status that best preserves our initial model?

CodePudding user response:

When you change a repository on GitHub from public to private or vice versa, it is detached from the other repositories in its network, and it loses the ability to make pull requests to the original repository or forks in its network.

This is because GitHub shares objects between repositories in the same network, and it's possible to access objects in a different fork in the network through the original repository. As a result, it would be insecure to allow one of the repositories to be public and another to be private, since anyone on the Internet could get access to the private data.

If the main repository is private, then you must not make your repo public, no matter what your TA says, if you want it to remain as part of the same network. Instead, try adjusting the permissions in the repository settings to allow the TA to access it.

CodePudding user response:

Suppose, the original repo is "X" and your detached fork repo is "Y". As it is not possible to link "Y" under "X" directly, create a fork "Z" from "X" and duplicate "Y" to "Z". Now, "Z" will contain the contents of "Y" and will show as forked of "X". Using "Z", you will be able to make pull requests to the original repository or forks in its network.

Follow this link to duplicate a GitHub repo: https://docs.github.com/en/repositories/creating-and-managing-repositories/duplicating-a-repository

For more details, please check: Reattach a "Detached" fork in Github?

  • Related