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:5c605e5e-2ed1-3f53-2b49-f4e6a636b2e4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E688:1BEA8C:1E9F3:29238:6A6286B2 |
| html-safe-nonce | 3bbe60e9e3110deb442fb79dd2ee71fec1dfcd2c88a1282ca542c8d0f358fdb1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNjg4OjFCRUE4QzoxRTlGMzoyOTIzODo2QTYyODZCMiIsInZpc2l0b3JfaWQiOiI0NjQyMzU0NDQwMzQ3NzQ4MDE4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 36fc784619fbad9553c6b87c582f3ce1884317d2f4b716527de1ca72fd91aa0f |
| 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 | 7a4ef49a11a2c05de16a801b29c54a151d2e3262d6fd17381ca13b5ae25dda8f |
| 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 | 97b18c8f1d2683a31995fd6e802daf9bf0d4d3f0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width