GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Unable to remove directory when head is used · Issue #2101 · gitpython-developers/GitPython

Unable to remove directory when head is used #2101

New issue
Copy link
New issue
Copy link
Closed
Bug
#2308
Closed
Unable to remove directory when head is used#2101
Bug
#2308
Copy link
Labels
waiting for feedback

Description

@cbfbl
cbfbl
opened on Feb 16, 2026
Issue body actions

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"

Activity

  1. Byron
    added
    waiting for feedback
    on Feb 19, 2026
  2. Byron commented on Feb 19, 2026

    @Byron
    Byron
    on Feb 19, 2026
    Member
    More actions

    Which platform is this on? I must presume Windows, and if so, that's a known issue with no solution.

  3. Byron
    added the
    Bug
    issue type on Jul 20, 2026
  4. Byron
    added a commit that references this issue on Oct 25, 2026

    docs(repo): demonstrate closing repositories before deletion (#2101)

    390fe8b
  5. Byron
    closed this as completedin #2308on Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    waiting for feedback

    Type

    Bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.