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 kind of issue on Windows 7 and it turned out to be due to some orphaned git.exe
process.
To solve it, open Task Manager and kill all git.exe
processes.
Since git
commands are short-lived, you should normally never see any git.exe
in Task Manager. When they are there, it usually means something is wrong, and you should kill those processes.
I ran into this issue running git Bash and Eclipse EGit at the same time.
Solution: close Eclipse. Also wouldn't hurt to run git gc
as @khilo mentioned.
In my case there are no processes touching the file or directory. Maybe it happens if the path is very long, because an operating system restriction (windows). Try enabling the longpath support flag in the global git configuration as indicated below:
git config --global core.longpaths true
or try to setting the yes/no answer flag if it is not conflictive for you
set GIT_ASK_YESNO=false
If the path is too long, I've not found a successful solution.
I was able to solve this by opening Powershell as Administrator and from there
git checkout <branch_name>
I faced same issue while doing 'git pull'. I tried manual housekeeping git command 'git gc' and it resolved my problem.
This may be a separate gitk window running to see some git history.
Just close that window to fix that problem.