I created a git repository with git init
. I\'d like to delete it entirely and init a new one.
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.