git reset --hard HEAD
git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# "LIFE/uploads/docs/Community_Plan_onlineA\314\203\342\200\240%92.pdf"
nothing added to commit but untracked files present (use "git add" to track)
現在,一般做一個乾淨就會改掉這個未跟蹤文件。
git clean -df
Removing "LIFE/uploads/docs/Community_Plan_onlineA\314\203\342\200\240%92.pdf"
我不過gettings這
git status
# On branch master
# Changes not staged for commit:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# deleted: "LIFE/uploads/docs/Community_Plan_online\303\203\342\200\240%92.pdf"
#
no changes added to commit (use "git add" and/or "git commit -a")
注意略有不同的文件名(_Plan_online \ 303,而不是_Plan_onlineA \ 314)。 什麼是導致此文件粘滯?我拉OSX btw與core.autocrlf = false
感謝您的解釋。我預計它必須處理文件名編碼,但你真的提供了一個很好的問題描述。我們正在混合的Windows/Mac環境中工作,所以我懷疑該文件是從Windows推入的。順便說一句,這個問題仍然存在於最新的git 1.8.2版本中。 – Alkaline 2013-04-06 07:48:17
歡迎您@Alkaline - 酷用戶名。 – 2013-04-06 16:33:58