Skip to content

Unable to remove directory when head is used #2101

@cbfbl

Description

@cbfbl

GitPython 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 assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions