现象

git 在 push 到远程服务器时出错,提示类似如下信息:

1
2
3
failed to read object *:
Interrupted system call
error: failed to push some refs to *

可以表现在直接 push 时,也可以表现在诸如 hexo deploy 等使用 git push 的脚本中。

分析

无一例外都发生在如下条件下,MacOS 系统,使用了 NTFS 分区做存储,使用 TuxeraNTFS 做读写,所以,应该是一个 bug 吧

解决方案

要么把要提交的文件夹移动到非 NTFS 分区,要么 git 时添加 –force 参数,类似如下格式

1
git push origin +master --force