Oftenly when I do a git pull --rebase
I get this kind of output:
> git pull --rebase
Auto packing the repository in background for optimum performance.
See "git help gc" for manual housekeeping.
Enumerating objects: 249988, done.
Counting objects: 100% (249988/249988), done.
Delta compression using up to 12 threads.
Compressing objects: 100% (62830/62830), done.
Writing objects: 100% (249988/249988), done.
Total 249988 (delta 179539), reused 249988 (delta 179539)
Unlink of file '.git/objects/pack/pack-00a0089ffcdc3d5ea5d2cc81042b741ba6d55a7d.idx' failed. Should I try again? (y/n)
The question is repeated a hundred or so times for each file that is suppossedly locked.
The referred file can be anything random-ish, but it is always a file in the .git/objects/pack/
directory. As far as I can tell, there's no other software keeping those files locked.
It seems like this problem occurs mostly after switching branches.
I'm using Git 2.18 on Windows 10.
I prefer not to dive into WLS or git-bash. While that would be a workaround to get the rebase to work, I do eventually want to get rid of this problem on the regular command prompt.
Another workaround is to execute git gc
first. That command is somehow able to release these files and make subsequent commands work as expected.
This question seems like a duplicate of my question, but speaks of a fix in Git 2.8 (which we are pretty far beyond by now) and the poster uses git-bash, which is a different scenario anyway.