无法删除.git目录


1

我尝试运行,sudo rm -rf .git/但终端返回以下消息:

rm: cannot remove ‘.git/objects/pack/pack-3818f69fa7bd64ef22c94c0bf630c18333cd5da9.idx’: Operation not permitted 
rm: cannot remove ‘.git/objects/pack/pack-3818f69fa7bd64ef22c94c0bf630c18333cd5da9.pack’: Operation not permitted

另外,我尝试运行chattr -i filename,但它也返回错误:

chattr: Inappropriate ioctl for device while reading flags on .git/objects/pack/pack-3818f69fa7bd64ef22c94c0bf630c18333cd5da9.idx

你写许可吗? chmod -R +w .git然后rm -rf .git应该工作。
abu_bua

难道ls -l在这两个文件。

挂载选项或父目录的权限可能有问题。我的pathlld脚本将向您显示最新情况。参见github.com/waltinator/pathlld.git-Bash脚本回答“为什么我不能读/写该文件?”
waltinator

Answers:


0

找到了解决方案:我只是将.git文件夹重命名为另一个名称并将其删除。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.