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?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.