Unlink of file Failed. Should I try again?

前端 未结 30 3508
臣服心动
臣服心动 2020-12-02 03:44

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         


        
相关标签:
30条回答
  • 2020-12-02 04:22

    In my case (Win8.1, TortoiseGit running), it was the process called "TortoiseSVN status cache" that was locking the file.

    Killing it allowed me to run "git gc" without any more problems. The above process is fired up by TortoiseGit, so there is no need to manually restart it.

    0 讨论(0)
  • 2020-12-02 04:23

    As stated above, something else is holding the files. Thing is that program doesnt look suspicious for us. I was trying to do a git pull from console, while having GitKraken opened. Closing GitKraken fixed the problem.

    0 讨论(0)
  • 2020-12-02 04:23

    Worked for me, Tried on windows:

    Stop your server running from IDE or close your IDE

    Intellij/Ecllipse or any, it will work.

    0 讨论(0)
  • 2020-12-02 04:24

    This could mean that another program is using the file, which is preventing git from "moving" the file into or out of the working directory when you are attempting to change branches.

    I have had this happen on Windows Vista where eclipse is the program "using" the file. The file may not be actually open in eclipse but may have been opened by a process run by eclipse.

    In this event, try closing the file in any applications that might have used it. If that doesn't work, completely exit any applications which may have opened the file.

    0 讨论(0)
  • 2020-12-02 04:24

    After none of the above answers seemed to work, running git fetch -p did the job for me.

    https://git-scm.com/docs/git-fetch

    0 讨论(0)
  • 2020-12-02 04:25

    I encountered this issue while doing a git pull.

    I tried git gc and it resolved my problem.

    0 讨论(0)
提交回复
热议问题