I\'m trying to do a git pull and I get the following error:
Unlink of file \'lib/xxx.jar\' failed. Should I try again? (y/n)
No
The problem is because you're having some program that handling these files. I have an suggestion that you should use the Unlocker to find the program that's handling it:
Unlocker
Closed Visual Studio and Rubymine and didn't get the error again. One of them was the culprit.
For me, it was because Visual Studio was trying to reload all of the changed files from the pull. Have visual studio refresh, then run git gc
.
I have had this happen on Windows XP, both with the message stuck in a loop, and being able to be cleared by replying.
The stuck-in-a-loop occurence was cleared by closing the Git-GUI. (I was running git merge -i in a bash shell.)
The other occurences happened possibly due to the large number of files in my repository. It happened mainly with .cod files, which I later exclude from version control. (I do have a reason for intially tracking them.) I believe the cause might be related to the rate at which Git uses file handles.
I wonder if the able-to-be-cleared-by-replying problem is Windows related, as two previous posters have mentioned Windows, and no one has said they have the problem with other operating systems.
In my case I had an old method of pruning tags causing the issue. I solved it by unsetting the original:
git config --global --unset remote.origin.fetch '\+refs/tags/\*:refs/tags/\*'
then adding this to prune deleted branches on the server:
git config --global fetch.pruneTags true
Close your IDE then do git pull
. It will work.