[英]Cannot remove .git/: Directory not empty
我有一個要刪除的 .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”文件和所有問號。
非常感謝您的幫助。
?????????? ? ? ? ?...
?????????? ? ? ? ?...
?????????? ? ? ? ?...
ls 的 output 可能表示您缺少訪問此文件的正確權限。 如果這是問題所在,您可以嘗試使用以下命令授予自己對父目錄及其子目錄的權限:
sudo chmod -R g+x .git/
要刪除非空文件夾,請使用-rf
標志
$ rm -rf.git
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.