Git error - unable to unlink old 'some/file/na

2020-02-24 06:58发布

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 descriptor)

What does this mean?

5条回答
The star\"
2楼-- · 2020-02-24 07: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.

查看更多
我只想做你的唯一
3楼-- · 2020-02-24 07:30

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.

查看更多
做自己的国王
4楼-- · 2020-02-24 07:33

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

查看更多
beautiful°
5楼-- · 2020-02-24 07:36

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

查看更多
在下西门庆
6楼-- · 2020-02-24 07:38

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?

查看更多
登录 后发表回答