[英]How to remove .git directory when rm -rf fails?
I am trying to remove the git files associated with a project by running:我正在尝试通过运行来删除与项目关联的 git 文件:
[#]: rm -rf .git
I get the following result:我得到以下结果:
rm: cannot remove ‘.git/hooks’: Directory not empty
Looking in .git/hooks
I have tried to see ls -l
what is there and I get this weird response:查看
.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
I have tried to remove these files individually and that does not work either.我试图单独删除这些文件,但也不起作用。 Eg:
例如:
[#]: rm applypatch-msg.sample
rm: cannot remove ‘applypatch-msg.sample’: No such file or directory
How can I remove this git directory from the project?如何从项目中删除这个 git 目录?
I am trying to remove the git files associated with a project by running:我正在尝试通过运行来删除与项目关联的 git 文件:
[#]: rm -rf .git
I get the following result:我得到以下结果:
rm: cannot remove ‘.git/hooks’: Directory not empty
Looking in .git/hooks
I have tried to see ls -l
what is there and I get this weird response:查看
.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
I have tried to remove these files individually and that does not work either.我试图单独删除这些文件,但也不起作用。 Eg:
例如:
[#]: rm applypatch-msg.sample
rm: cannot remove ‘applypatch-msg.sample’: No such file or directory
How can I remove this git directory from the project?如何从项目中删除这个 git 目录?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.