I am not able to override/delete the folder containing .git in python. I am working on the below configuration:
- OS - Windows 8
- Python - 3.5.2
- Git - 2.9.2
Any Help would be appreciated.
I am not able to override/delete the folder containing .git in python. I am working on the below configuration:
Any Help would be appreciated.
You should be using shutil to remove a directory that's not empty. If os.rmdir
is used on a directory that's not empty an exception is raised.
import shutil
shutil.rmtree('/.git')
try this code
import shutil
shutil.rmtree('/path/to/your/dir/')
try this, It will work
os.system('rmdir /S /Q "{}"'.format(baseDirectory))