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"
然而,我得到了这个
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)。是什么导致这个文件粘住?我正在使用 core.autocrlf=false 使用 OSX