我想从我的本地机器中彻底删除整个git仓库,但是git禁止删除一些文件。
我尝试了:
rm -r folder
- 它问我是否要删除一些受写保护的文件?我回答了
y
。 出现了以下消息:
rm: cannot remove ‘.git/objects/08/fa4fcd8413b84a1605e1c4866cb2493daf4c4e’: Operation not permitted
rm: cannot remove ‘.git/objects/96/de4fe9aa42239290cae341427649f2afbdab16’: Operation not permitted
rm: cannot remove ‘.git/objects/fd/ed37600b5fe66e1a0d0e4355b387e56ca2638e’: Operation not permitted
rm: cannot remove ‘.git/objects/pack/pack-cb277ab3b4a3510209a9784a76760e6281da5218.idx’: Operation not permitted
rm: cannot remove ‘.git/objects/pack/pack-cb277ab3b4a3510209a9784a76760e6281da5218.pack’: Operation not permitted
ls
命令显示所有本地文件已被删除。然后我尝试从那个文件夹运行 sudo rm -r .git
,但结果相同。
请帮我删除这个文件夹。
ls -la
命令来检查确切的权限。 - zerkmssudo rm -r
会失败。 - Thanatos