Git error - unable to unlink old 'some/file/name' (Bad file descriptor)

后端 未结 6 1929
半阙折子戏
半阙折子戏 2020-12-29 18:51

When trying to switch/checkout (in TortoiseGit) to another branch, I get the following error:

error: unable to unlink old \'foo/bar.cfc\' (Bad file descripto         


        
相关标签:
6条回答
  • 2020-12-29 19:16

    I ran into this problem-Eclipse was locking the file even though it wasn't open in the editor. Once I closed eclipse I could checkout fine.

    0 讨论(0)
  • 2020-12-29 19:20

    The file is locked by another program and cannot be overwritten. See what application has the file locked, close that application, and try again.

    0 讨论(0)
  • 2020-12-29 19:28

    If your problem is based on eclipse locking file, you can start your eclipse with -Dosgi.locking=none. I ran into this problem with eclipse Luna 4.4.0

    0 讨论(0)
  • 2020-12-29 19:29

    Are you using any other tools while using TortoiseGit?

    For instance, this project mentions an interaction with Visual Studio:

    If you see errors about being unable to unlink old files when running git commands on Windows, it's quite likely that you have the chrome solution open in Visual Studio and it's updating IntelliSense, which will briefly lock files at random.
    The workaround is either to disable IntelliSense entirely, or to be sure to close the solution temporarily while performing any git operations which could touch a large number of files.

    In other word, does the problem persists if you close as many currently running applications as you can?
    Would TortoiseGit allow you to checkout another branch then?

    0 讨论(0)
  • 2020-12-29 19:29

    I got same error with github desktop app when i try to pull. I solved it by closing visual studio and running github desktop app in admin mode.

    0 讨论(0)
  • 2020-12-29 19:30

    Make a bat file with the below and run it. It will restart
    explorer, which is the cause usually if not your IDE

    taskkill /f /IM explorer.exe
    start explorer.exe
    exit
    
    0 讨论(0)
提交回复
热议问题