无法删除 .git 目录

无法删除 .git 目录

我尝试运行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

答案1

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

相关内容