我有一個要洗掉的 .git/ 檔案夾。但是,這是不可能的,因為其中有一個無法訪問的令人費解的檔案。
下面是我的嘗試:
$ rm -rf .git/
rm: cannot remove '.git/': Directory not empty
$ rm -r .git/
rm: descend into directory '.git/'? y
rm: cannot remove '.git/t8QVta1': No such file or directory
rm: remove directory '.git/'? y
rm: cannot remove '.git/': Directory not empty
$ ls -l .git/
ls: cannot access '.git/t8QVta1': No such file or directory
total 0
?????????? ? ? ? ? ? t8QVta1
$
我不知道“t8QVta1”檔案和所有問號是什么。
非常感謝您的幫助。
uj5u.com熱心網友回復:
ls的?????????? ? ? ? ?...輸出可能表明您缺少訪問此檔案的正確權限。如果這是問題所在,您可以嘗試使用以下命令授予自己對父目錄及其子目錄的權限:
sudo chmod -R g x .git/
uj5u.com熱心網友回復:
要洗掉非空檔案夾,請使用-rf標志
$ rm -rf .git
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/458827.html
