我正在尝试通过运行以下命令来删除与项目关联的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目录?
答案 0 :(得分:-2)
尝试
rmdir .git
或
rm -r .git