Unlink of file Failed. Should I try again?

前端 未结 30 3506
臣服心动
臣服心动 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:25

    I tried every single tip on this page and nothing helped. I was doing a git fetch and a git reset --hard origin/development gave me the unkink error. I couldn't reset to the latest commit.

    What helped was checking out another branch and then checking out the previous branch. Very strange but it solved the problem.

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

    This might be useful for someone; if all the above didn't work for you, follow these steps:

    1. Close your IDE (mine was Eclipse, not sure if it applies to Intellij and others) or any other app that might be using git.

    2. Open git from the command line (in my case I had git bash) and run git gc as mentioned by others.

    This did the magic for me.

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

    I had the same issue while doing a git pull and as stated above, it was because of a program that was holding those files and was not allowing a git pull. Closing the program helped. Usually, the IDE (like Eclipse) from where the files are being checked-in will be holding it in the background. Closing the same and re-running git pull solved the problem for me.

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

    After trying various solutions finally git clean -f helped me.

    EDIT: I hit the problem again few times - closing all processes dependent on git seems to help (like gitbash, Eclipse IDE, etc.)

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

    If you are developing a web application, a common reason is to forget shutting down the server. For example this could be a simple Node.js process, or on windows your IIS process running more unobtrusive as background process.

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

    If you're using Docker and running Windows 10, you may want to stop the container(s) where the file may be running at. To show the statuses of your containers, run

    docker ps -a

    To stop them, simply run

    docker stop <container name or container id>

    This worked for me as I am running my local files using a .sh file

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