Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 496
Tariq Ahmed Avatar asked Dec 15 '10 16:12

Tariq Ahmed


3 Answers

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?

like image 153
VonC Avatar answered Nov 17 '22 17:11

VonC


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.

like image 39
Zach Wymer Avatar answered Nov 17 '22 16:11

Zach Wymer


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

like image 21
James Lawruk Avatar answered Nov 17 '22 15:11

James Lawruk