Something wrong is going on with one of the files in my local git repository. When I\'m trying to change the branch it says:
Unlink of file \'templates/media
I had this issue with .tmp
files in /.git/objects/pack
folder. I think something had failed during a push or pull, so I removed these temporary files and reset the HEAD to my last commit. Not sure if this is advised but it worked for me. Also git count-objects -v
gave me a list of the .tmp
files that didn't belong in the pack folder.
Or to suppress the y/n messages in windows git open cmd.exe
and run:
SETX GIT_ASK_YESNO false
seen here: https://twitter.com/petercamfield/status/494805475733807104
On Windows 8: I ran git gc and it said git gc was already running, I ran git gc --force and the garbage collector ran.
I could then switch branches and merge without any issues, try git gc --force.
Perhaps the gc process didn't stop gracefully for one reason or another.
After run command
git rm -rf foo.bar
I see error
Unlink of file 'foo.bar' failed. Should I try again? (y/n)
Because another program is using this file. For example, when I run Java web application in debug model or run web application on server, I can't delete log file. Turn off application sever (or turn off debug process), re-try
git rm -rf foo.bar
I see file has been deleted.
If closing your IDE and running various git commands listed here won't help, try manually killing all running Java processes. I had a Java process probably left over from eclipse that somehow kept a configuration file open.
I had this issue and solved it by the command : git gc
The above command remove temp and unnecessary files. (Garbage collector.)
I tried git gc
and it resolved my problem.