我尝试运行,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
挂载选项或父目录的权限可能有问题。我的
—
waltinator
pathlld
脚本将向您显示最新情况。参见github.com/waltinator/pathlld.git-Bash脚本回答“为什么我不能读/写该文件?”
chmod -R +w .git
然后rm -rf .git
应该工作。