1

I have a repo on github and I need to complete reset it , i.e start uploading from scratch. How exactly do I remove all files and directories in the repository using git?

ApprenticeHacker
  • 21,351
  • 27
  • 103
  • 153

1 Answers1

2

One option is to take your local copy of the new repo, set it up as normal, then run git push --force origin master (or whatever you’ve named your remote and branch). This won’t actually delete all the files, directories and history (at least not immediately), but they will no longer be reachable from your head, which is all you need unless you really want to make it impossible to retrieve the existing files.

dhwthompson
  • 2,501
  • 1
  • 15
  • 11