Git:致命的:'sha1文件'上的fsync错误:错误的文件描述符 [英] Git: fatal: fsync error on 'sha1 file': Bad file descriptor

查看:252
本文介绍了Git:致命的:'sha1文件'上的fsync错误:错误的文件描述符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将VS Code与Git一起使用-它位于可移植位置C:\ _ DEV \ bin \ git,并且还添加到Windows PATH中,因此在没有遥控器的情况下也可以正常工作.

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.

我有一个OneDrive _GIT 文件夹,其中有一些远程"存储库,可以在2台设备之间进行同步(有时,我在那里主要是出于备份目的).

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.

我认为这是由于OneDrive之间的同步.有可以运行的命令来修复文件描述符吗?还是其他预防方法?

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

推荐答案

感谢@ edward-thomson.
我在PC上遇到了同样的问题,我将homedrive下的文件夹映射到E:

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

解决方案是使用CMD中的完整路径,或者使用git bash从homedrive快捷方式:

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

~/E-Folder/SomeGitProject

我想您的A:同样是一个共享,您可以使用完整路径访问该路径,该路径也可能位于主驱动器下的某个位置.

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

这篇关于Git:致命的:'sha1文件'上的fsync错误:错误的文件描述符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆