繁体   English   中英

rm -rf 失败时如何删除 .git 目录?

[英]How to remove .git directory when rm -rf fails?

我正在尝试通过运行来删除与项目关联的 git 文件:

[#]: rm -rf .git

我得到以下结果:

rm: cannot remove ‘.git/hooks’: Directory not empty

查看.git/hooks我试图查看ls -l那里有什么,但我得到了这个奇怪的响应:

ls: cannot access commit-msg.sample: No such file or directory
ls: cannot access pre-rebase.sample: No such file or directory
ls: cannot access applypatch-msg.sample: No such file or directory
ls: cannot access pre-commit.sample: No such file or directory
ls: cannot access update.sample: No such file or directory
ls: cannot access pre-applypatch.sample: No such file or directory
ls: cannot access post-update.sample: No such file or directory
applypatch-msg.sample  pre-applypatch.sample  update.sample
commit-msg.sample      pre-commit.sample
post-update.sample     pre-rebase.sample

我试图单独删除这些文件,但也不起作用。 例如:

[#]: rm applypatch-msg.sample
rm: cannot remove ‘applypatch-msg.sample’: No such file or directory

如何从项目中删除这个 git 目录?

我正在尝试通过运行来删除与项目关联的 git 文件:

[#]: rm -rf .git

我得到以下结果:

rm: cannot remove ‘.git/hooks’: Directory not empty

查看.git/hooks我试图查看ls -l那里有什么,但我得到了这个奇怪的响应:

ls: cannot access commit-msg.sample: No such file or directory
ls: cannot access pre-rebase.sample: No such file or directory
ls: cannot access applypatch-msg.sample: No such file or directory
ls: cannot access pre-commit.sample: No such file or directory
ls: cannot access update.sample: No such file or directory
ls: cannot access pre-applypatch.sample: No such file or directory
ls: cannot access post-update.sample: No such file or directory
applypatch-msg.sample  pre-applypatch.sample  update.sample
commit-msg.sample      pre-commit.sample
post-update.sample     pre-rebase.sample

我试图单独删除这些文件,但也不起作用。 例如:

[#]: rm applypatch-msg.sample
rm: cannot remove ‘applypatch-msg.sample’: No such file or directory

如何从项目中删除这个 git 目录?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM