xxxxxxxxxx
On Windows:
Go to the directory where you want to delete your .git folder then type in cmd
rmdir /S .git.
xxxxxxxxxx
import shutil
# Specify the path to the repository
repository_path = '/path/to/your/repository'
# Delete the repository directory
shutil.rmtree(repository_path)