Unable to remove directory when head is used · Issue #2101 · gitpython-developers/GitPython
Repository navigation
Unable to remove directory when head is used #2101
New issue
New issue
Closed
Bug #2308
Closed
Unable to remove directory when head is used #2101 Bug #2308 Labels
waiting for feedback
Description
@cbfbl's profile cbfbl opened on Feb 16, 2026GitPython version - 3.1.46
Python version - 3.13.9
Basically the following fails
import shutil
from git import repo
repo = Repo("some_url", "some_directory")
print(repo.head.commit.hexsha)
shutil.rmtree("some_directory")
Getting an error shutils rmtree failed and was not able to the delete the .git inside "some_directory"
Metadata
Metadata
Assignees
No one assignedLabels
waiting for feedback