1

I am having issues with git on my local machine. I would like to delete all branches on my machine and start all over again by cloning the project from git.

Note: that I don't want to delete the branches on GitHub.com. Delete locally only.

Junior
  • 10,784
  • 25
  • 91
  • 192
  • 1
    Possible duplicate of [Need to reset git branch to origin version](https://stackoverflow.com/questions/9301782/need-to-reset-git-branch-to-origin-version) – Daniel Mann Jun 16 '19 at 18:08
  • 2
    SUGGESTION: 1) rename your current project `myproject.bu`, then 2) git clone` into a brand new directory. – paulsm4 Jun 16 '19 at 18:09

2 Answers2

3

As long as you're ok with losing all work that you've done locally, you can simply delete the root folder of your project.

frodo2975
  • 8,366
  • 3
  • 28
  • 37
2

Several alternatives:

  1. Save a backup of your local work, and go back to the Github version:

    • Rename your current project directory and re-clone from Github.
  2. Undo all your local changes, and go back to the last local commit:

    • git reset --hard HEAD
  3. Reset your local project to the Github version:

It depends on exactly what you're trying to accomplish.

paulsm4
  • 107,438
  • 16
  • 129
  • 179