Title: Unable to remove directory when head is used · Issue #2101 · gitpython-developers/GitPython · GitHub
Open Graph Title: Unable to remove directory when head is used · Issue #2101 · gitpython-developers/GitPython
X Title: Unable to remove directory when head is used · Issue #2101 · gitpython-developers/GitPython
Description: 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...
Open Graph Description: 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.r...
X Description: 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.com...
Opengraph URL: https://github.com/gitpython-developers/GitPython/issues/2101
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unable to remove directory when head is used","articleBody":"GitPython version - 3.1.46\nPython version - 3.13.9\n\nBasically the following fails\n\n\n```\nimport shutil\nfrom git import repo\n\nrepo = Repo(\"some_url\", \"some_directory\")\nprint(repo.head.commit.hexsha)\nshutil.rmtree(\"some_directory\")\n```\n\n\nGetting an error shutils rmtree failed and was not able to the delete the .git inside \"some_directory\"","author":{"url":"https://github.com/cbfbl","@type":"Person","name":"cbfbl"},"datePublished":"2026-02-16T18:18:29.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/2101/GitPython/issues/2101"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:34fe0d3a-1686-f281-a1be-a6ea539a05ca |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EB6A:26037E:2CE0DF:3F778A:6A637724 |
| html-safe-nonce | 99a1b46c371c9b402646b4929d811424c9f7fc30ee7fdab9c30e30e51988d6b0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjZBOjI2MDM3RToyQ0UwREY6M0Y3NzhBOjZBNjM3NzI0IiwidmlzaXRvcl9pZCI6IjIwOTI2Mzc1NTMwNzAxNDMyNjgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 70447222a870e79e822c170a47614bd0b6fbe0453fb47c4a560faaa4dacffb45 |
| hovercard-subject-tag | issue:3949007751 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/gitpython-developers/GitPython/2101/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b8bf623e2deb32fbadfa04e6a9177853be8681ba8fdcb30f41af65a9bfaeefd5/gitpython-developers/GitPython/issues/2101 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b8bf623e2deb32fbadfa04e6a9177853be8681ba8fdcb30f41af65a9bfaeefd5/gitpython-developers/GitPython/issues/2101 |
| og:image:alt | 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.r... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | cbfbl |
| hostname | github.com |
| expected-hostname | github.com |
| None | 15e78334bb345f3864e70c5a376ed0383374123629b9e3022398d9431f6cd8bf |
| turbo-cache-control | no-preview |
| go-import | github.com/gitpython-developers/GitPython git https://github.com/gitpython-developers/GitPython.git |
| octolytics-dimension-user_id | 503709 |
| octolytics-dimension-user_login | gitpython-developers |
| octolytics-dimension-repository_id | 1126087 |
| octolytics-dimension-repository_nwo | gitpython-developers/GitPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1126087 |
| octolytics-dimension-repository_network_root_nwo | gitpython-developers/GitPython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 51da2d8d0a841a1393b806a6559fa9ad757e1666 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width