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?
Asked
Active
Viewed 69 times
0

Ishtiaq Naqi
- 19
- 6
-
This person has answered the question, i got my issue solved [click here](https://stackoverflow.com/questions/9050914/how-can-i-remove-all-files-in-my-git-repo-and-update-push-from-my-local-git-repo) – Ishtiaq Naqi Dec 03 '22 at 02:16
1 Answers
1
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.

torek
- 448,244
- 59
- 642
- 775
-
-
1Commits are history, and there's no way for *you* to *remove commits* from a GitHub repository except to delete that repository. This is why, for instance, if you've ever pushed a commit with a password to GitHub, you should consider that password compromised. – torek Dec 03 '22 at 03:09
-
What does password compromised means? Is it like that if I changed my password I won't be able to reach the commits I made with the old password? – Ishtiaq Naqi Dec 03 '22 at 20:03
-
"password compromised" means that you have to assume now that the password is known by others. – tymtam Dec 04 '22 at 05:11