chmod操作后损坏的git存储库 [英] Broken git repository after chmod operation

查看:64
本文介绍了chmod操作后损坏的git存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在对超过5000个文件进行了 chmod -R 755/.../[repo_root]/some_inner_project_folder 之后, git add. git commit-m"..." git push 我遇到了系统调用中断错误.

After I did chmod -R 755 /.../[repo_root]/some_inner_project_folder upon more then 5000 files, git add . and git commit -m "..." and git push I've got Interrupted system call errors.

我通过重新克隆存储库并复制新旧存储库之间的差异解决了我的问题.

I solved my problem by re-clone the repository and copy over whatever is differ between new and old local repository.

但是我一直在用git遇到这个问题,不知道如何避免它.因此,发生错误后,我从 git fsck 中得到了类似的信息:

But I'm continuously getting this issue with git and not sure how to avoid it. So after error, I'm getting something like this from the git fsck:

error: unable to mmap .git/objects/03/503a48d98793cd58fbdf18e6f2aafa19616a15: Interrupted system call
error: 03503a48d98793cd58fbdf18e6f2aafa19616a15: object corrupt or missing: .git/objects/03/503a48d98793cd58fbdf18e6f2aafa19616a15

有时候,我使用 git gc --aggressive --prune = now --force 成功,有时却不成功.

Sometimes, I'm successful with git gc --aggressive --prune=now --force and sometimes not.

它发生在多个开发人员使用的存储库上,而仅发生在我自己使用的存储库上.

It happened on the repository used by multiple devs and upon the one used by me only.

更新1

我正在使用的文件属于git存储库的内部文件夹.我没有碰过 .git 文件夹.

The files I was working with belong to inner folder of the git repository. I didn't touch the .git folder.

推荐答案

此问题与 Trend Micro Security 有关,为我收到了多个中断的系统调用",而且我无法再执行 git push .因此,我将这些git仓库标记为不可修复.

I was getting multiple "interrupted system call" and I couldn't do git push anymore. So I marked these git repos as non fixable.

该问题在我在特定项目的顶部提到的 chmod 命令之后出现,但是当我卸载趋势科技安全管理系统时,我能够通过 git gc 修复该项目,如下所示:也提到了.

The issue appeared after chmod command I mentioned on top in the particular project, but when I uninstall the Trend Micro Security I was able to fix project by git gc as mentioned as well.

这篇关于chmod操作后损坏的git存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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