0
我使用git 1.7.9.5,並且我有一個目錄_hashdist
,其中沒有跟蹤文件。這是我的.gitignore
:git clean -dfx不會刪除被忽略的目錄
*~
*.pyc
*.pyo
/opt
/bld
/db
/src
/_hashdist
/local
因此將其忽略,如圖:
$ git status --ignored
# On branch master
# Ignored files:
# (use "git add -f <file>..." to include in what will be committed)
#
# _hashdist/
nothing to commit (working directory clean)
然後我想通過將其刪除:
$ git clean -dfx
Removing _hashdist/
它正確地說,這是刪除它。但沒有實際發生:
$ git status --ignored
# On branch master
# Ignored files:
# (use "git add -f <file>..." to include in what will be committed)
#
# _hashdist/
nothing to commit (working directory clean)
或
$ ls -d _hashdist/
_hashdist/
的目錄仍然存在。這對我來說非常困難,因爲我一直使用git clean -dfx
來清理所有內容,而這是第一次不起作用。
是的,git應刪除該目錄,但顯然無法這樣做。用'rm -rf _hashdist'手動刪除工作嗎? – michas
是的,手動刪除目錄工作正常(這是我一直在做的事情,這只是令人討厭)。 –