{"action":"created","issue":{"url":"https://api.github.com/repos/git-for-windows/git/issues/500","labels_url":"https://api.github.com/repos/git-for-windows/git/issues/500/labels{/name}","comments_url":"https://api.github.com/repos/git-for-windows/git/issues/500/comments","events_url":"https://api.github.com/repos/git-for-windows/git/issues/500/events","html_url":"https://github.com/git-for-windows/git/issues/500","id":112578175,"number":500,"title":"Unlink of file XXX failed. Should I try again?","user":{"login":"gpakosz","id":553208,"avatar_url":"https://avatars.githubusercontent.com/u/553208?v=3","gravatar_id":"","url":"https://api.github.com/users/gpakosz","html_url":"https://github.com/gpakosz","followers_url":"https://api.github.com/users/gpakosz/followers","following_url":"https://api.github.com/users/gpakosz/following{/other_user}","gists_url":"https://api.github.com/users/gpakosz/gists{/gist_id}","starred_url":"https://api.github.com/users/gpakosz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gpakosz/subscriptions","organizations_url":"https://api.github.com/users/gpakosz/orgs","repos_url":"https://api.github.com/users/gpakosz/repos","events_url":"https://api.github.com/users/gpakosz/events{/privacy}","received_events_url":"https://api.github.com/users/gpakosz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/git-for-windows/git/labels/mcve-required","name":"mcve-required","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-21T12:37:06Z","updated_at":"2015-10-21T15:32:29Z","closed_at":null,"body":"Hello,\r\n\r\nSometimes, after a e.g. `git fetch`, Git decides to auto GC a repository. In the process, it fails to remove `.pack` and `.idx` files. Likely, those files are locked.\r\n\r\nGit can ask the question for more than 50 times depending on the number of unreachable commits there are following branch deletion and remotes pruning. When Git starts to complain, either you answer \"no\" repeatedly until the auto GC ends, or you have to CTRL-C. Ultimately, invoking `git gc` manually removes most of the pack files "},"comment":{"url":"https://api.github.com/repos/git-for-windows/git/issues/comments/149933531","html_url":"https://github.com/git-for-windows/git/issues/500#issuecomment-149933531","issue_url":"https://api.github.com/repos/git-for-windows/git/issues/500","id":149933531,"user":{"login":"kgybels","id":2051188,"avatar_url":"https://avatars.githubusercontent.com/u/2051188?v=3","gravatar_id":"","url":"https://api.github.com/users/kgybels","html_url":"https://github.com/kgybels","followers_url":"https://api.github.com/users/kgybels/followers","following_url":"https://api.github.com/users/kgybels/following{/other_user}","gists_url":"https://api.github.com/users/kgybels/gists{/gist_id}","starred_url":"https://api.github.com/users/kgybels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kgybels/subscriptions","organizations_url":"https://api.github.com/users/kgybels/orgs","repos_url":"https://api.github.com/users/kgybels/repos","events_url":"https://api.github.com/users/kgybels/events{/privacy}","received_events_url":"https://api.github.com/users/kgybels/received_events","type":"User","site_admin":false},"created_at":"2015-10-21T15:32:29Z","updated_at":"2015-10-21T15:32:29Z","body":"@dscho Something like this?\r\n\r\n    KGybels@PC-KG MINGW64 /c/git/bug\r\n    $ git --version\r\n    git version 2.6.1.windows.1\r\n    \r\n    KGybels@PC-KG MINGW64 /c/git/bug\r\n    $ ls\r\n    steps.sh*\r\n    \r\n    KGybels@PC-KG MINGW64 /c/git/bug\r\n    $ cat steps.sh\r\n    #!/bin/bash\r\n    \r\n    git init origin\r\n    cd origin\r\n    touch test1.txt\r\n    git add test1.txt\r\n    git commit -m v1\r\n    originpath=`pwd`\r\n    cd ..\r\n    git clone file://$originpath clone\r\n    cd origin\r\n    touch test2.txt\r\n    git add test2.txt\r\n    git commit -m v2\r\n    cd ../clone\r\n    git config gc.autoPackLimit 1\r\n    git fetch\r\n    \r\n    KGybels@PC-KG MINGW64 /c/git/bug\r\n    $ ./steps.sh\r\n    Initialized empty Git repository in C:/git/bug/origin/.git/\r\n    [master (root-commit) 775d4c6] v1\r\n     1 file changed, 0 insertions(+), 0 deletions(-)\r\n     create mode 100644 test1.txt\r\n    Cloning into 'clone'...\r\n    remote: Counting objects: 3, done.\r\n    remote: Total 3 (delta 0), reused 0 (delta 0)\r\n    Receiving objects: 100% (3/3), done.\r\n    Checking connectivity... done.\r\n    [master 25c50c7] v2\r\n     1 file changed, 0 insertions(+), 0 deletions(-)\r\n     create mode 100644 test2.txt\r\n    remote: Counting objects: 2, done.\r\n    remote: Compressing objects: 100% (2/2), done.\r\n    remote: Total 2 (delta 0), reused 0 (delta 0)\r\n    Unpacking objects: 100% (2/2), done.\r\n    From file:///c/git/bug/origin\r\n       775d4c6..25c50c7  master     -> origin/master\r\n    Auto packing the repository in background for optimum performance.\r\n    See \"git help gc\" for manual housekeeping.\r\n    Counting objects: 5, done.\r\n    Delta compression using up to 4 threads.\r\n    Compressing objects: 100% (3/3), done.\r\n    Writing objects: 100% (5/5), done.\r\n    Total 5 (delta 0), reused 3 (delta 0)\r\n    Unlink of file '.git/objects/pack/pack-97e500b3cd7317acb865c29bb44d66886116c51a.pack' failed. Should I try again? (y/n) n\r\n    Unlink of file '.git/objects/pack/pack-97e500b3cd7317acb865c29bb44d66886116c51a.idx' failed. Should I try again? (y/n) n\r\n    \r\n    KGybels@PC-KG MINGW64 /c/git/bug\r\n    $\r\n"}}