Git 错误 - 无法取消链接旧的“某些/文件/名称”(错误的文件描述符)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4452641/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Git error - unable to unlink old 'some/file/name' (Bad file descriptor)
提问by Tariq Ahmed
When trying to switch/checkout (in TortoiseGit) to another branch, I get the following error:
尝试切换/结帐(在 TortoiseGit 中)到另一个分支时,出现以下错误:
error: unable to unlink old 'foo/bar.cfc' (Bad file descriptor)
What does this mean?
这是什么意思?
回答by VonC
Are you using any other tools while using TortoiseGit?
您在使用 TortoiseGit 时是否使用任何其他工具?
For instance, this project mentionsan interaction with Visual Studio:
例如,这个项目提到了与 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.
如果您在 Windows 上运行 git 命令时看到有关无法取消链接旧文件的错误,很可能是您在 Visual Studio 中打开了 chrome 解决方案并且它正在更新 IntelliSense,它会随机短暂锁定文件。
解决方法是完全禁用 IntelliSense,或者确保在执行任何可能涉及大量文件的 git 操作时暂时关闭解决方案。
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?
换句话说,如果您尽可能多地关闭当前正在运行的应用程序,问题是否仍然存在?
TortoiseGit 会允许你结帐另一个分支吗?
回答by Zach Wymer
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.
我遇到了这个问题——Eclipse 正在锁定文件,即使它没有在编辑器中打开。一旦我关闭了日食,我就可以结帐了。
回答by James Lawruk
The file is locked by another program and cannot be overwritten. See what application has the file locked, close that application, and try again.
该文件已被其他程序锁定,无法覆盖。查看锁定文件的应用程序,关闭该应用程序,然后重试。
回答by victor
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
如果您的问题是基于 eclipse 锁定文件,您可以使用-Dosgi.locking=none
. 我在使用 eclipse Luna 4.4.0 时遇到了这个问题
回答by bthn
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.
当我尝试拉动时,我在 github 桌面应用程序上遇到了同样的错误。我通过关闭 Visual Studio 并在管理员模式下运行 github 桌面应用程序来解决它。