As the title describes, I need to remove a git repository by using python. I've seen other questions about this very same topic, but none of the solutions seem to work for me.
My work: I need to download a repository, using gitpython, followed by checking some irrelevant things. After the process is finished, I need to delete the repository to save space for whoever is using my script.
The problem: When cloning a git repository, a .git file will be created. This file is hidden in windows, and the modules I've been using do not have permission to delete any of the files within the .git folder.
What I've tried:
import shutil
shutil.rmtree('./cloned_repo')
PermissionError: [WinError 5] Access is denied:
Any help regarding this issue would be deeply appreciated.