How to fully delete a git repository created with init?

前端 未结 13 1916
再見小時候
再見小時候 2020-11-22 16:42

I created a git repository with git init. I\'d like to delete it entirely and init a new one.

13条回答
  •  [愿得一人]
    2020-11-22 17:33

    I tried:

    rm -rf .git and also

    Git keeps all of its files in the .git directory. Just remove that one and init again.

    Neither worked for me. Here's what did:

    • Delete all files except for .git
    • git add . -A
    • git commit -m "deleted entire project"
    • git push

    Then create / restore the project from backup:

    • Create new project files (or copy paste a backup)
    • git add . -A
    • git commit -m "recreated project"
    • git push

提交回复
热议问题