How to remove everything inside a github repository without removing the repository?

120 views Asked by At

During a classroom project a github repository with a new project was created by my instructor. The problem is before this repository I had my own project created with my a lot of work done, in the eleventh hour I found that it was difficult to transfer things from one repo to another, copy pasting created a lot of problems. Now I want to remove everything inside my remote repository (created using github classroom), without removing the repository itself, is it possible? I wasn't able to find similar cases on the internet, if I have missed out a ditto copy on stackoverflow sorry for brinigng it up again. How can I achieve my goal?

1

There are 1 answers

4
torek On

You can't. GitHub support staff can, but you literally can't, for various GitHub-specific reasons.

You can delete all but one branch name, and you can make a truly empty commit (using the empty tree and no parent or child commits) and set the last branch name to select that commit. However, all the commits you had in that repository will remain there, and can be found by their raw hash IDs, as long as whoever is looking can find the hash IDs somehow (guesswork, history, existing PRs and other issues, and so on).

Furthermore, the issues/PRs/etc database that GitHub maintain—which is not part of Git, but is part of your on-GitHub storage—has no option for cleaning it out.