How to fully delete a git repository created with init?

前端 未结 13 1801
再見小時候
再見小時候 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:11

    Where $GIT_DIR is the path to the folder to be searched (the git repo path), execute the following in terminal.

    find $GIT_DIR -name *.git* -ok rm -Rf {} \;
    

    This will recursively search for any directories or files containing ".git" in the file/directory name within the specified Git directory. This will include .git/ and .gitignore files and any other .git-like assets. The command is interactive and will ask before removing. To proceed with the deletion, simply enter y, then Enter.

提交回复
热议问题