Git: fatal: fsync error on 'sha1 file': Bad file descriptor

匿名 (未验证) 提交于 2019-12-03 01:05:01

问题:

I'm using VS Code with Git - it's in portable location C:\_DEV\bin\git and is also added to Windows PATH so it works just fine with no remotes.

I have a OneDrive _GIT folder where I have some of my "remote" repositories, that sync between 2 devices (sometimes, I have it there mainly for backup purposes).

The error appears when I want to commit changes, only way to "fix" this issue is to restart the computer, so I'd like to find a way how to fix it properly. The problem is, it doesn't appear always and not for all repositories, it's pretty random.

I think it's because of sync from/to OneDrive. Is there a command I can run to fix the file descriptor? Or other way to prevent it?

git remote --verbose git ls-tree -l HEAD -- a:\new\theme\assets\sass\main.scss git show 97a333c5e7fce816dbb46a5c1235d69e61836726 git show HEAD:theme/assets/sass/main.scss git add -A -- a:\new\theme\assets\sass\main.scss fatal: fsync error on 'sha1 file': Bad file descriptor 

回答1:

Thanks to @edward-thomson.
I had same problem on my PC, where i mapped a folder under my homedrive to E:

C:\Users\myuserid\E-Folder\SomeGitProject 

by sharing the folder, so i could shortcut it to

E:\SomeGitProject 

Solution was to use the full path in CMD or use the shortcut to homedrive from git bash:

~/E-Folder/SomeGitProject 

I guess your A: likewise is a share, that you can access with a full path probably also located somewhere under your homedrive.



回答2:

I am posting late to help others get to the solution faster than I did. The actual culprit was elusive, and I tried everything from re-installing GIT to creating new repositories.

This happened to me in windows and it was due to a change in permissions in a parent folder somewhere.

The solution was to simply disconnect and remap the folder.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!