用git rm直接删除中文文件名的文件时,不管加不加git提示的那个双引号,用git删除时都会提示路径找不到,
正确的方法有两种
1
修改git的配置
git config --global core.quotepath false
git config --help中的说明为:
core.quotePath
The commands that output paths (e.g. ls-files, diff), when not given the -z option, will quote "unusual" characters in the pathname by enclosing the
pathname in a double-quote pair and with backslashes the same way strings in C source code are quoted. If this variable is set to false, the bytes
higher than 0x80 are not quoted but output as verbatim. Note that double quote, backslash and control characters are always quoted without -z regardless
of the setting of this variable.
core.quotepath设为false的话,git不会对值为128以上的非ascii 码字符进行quote
2
在~/.gitconfig中加入这句
[core]
quotepath = false