How to delete the content of github repository?
11,442
Solution 1
In git, you can't delete the content of a branch. All you can do is to push a commit that removes all your files.
If you want to start over from a clean repository, you have to delete the current one a create a new one with the same name for example.
Solution 2
Just to support quentin's answer, adding the git commands:
Keep a backup of the local repository folder and remove all its contents.
Add these changes to commit
$ git add *
- Add a Commit message
$ git commit "Remove everything"
- Push changes
$ git push -f
Comments
-
MKH almost 2 years
I wrongly pushed my code using Xcode toolbar into my repository on github. now, I want to delete all files in my master branch, but not the repository. Then I want to pull my code into repository this time instead of pushing. Does any one know how to delete all contents of master branch?