簡體   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