用git rm file_name删除文件名带空格的文件时,会出现无匹配文件的错误
例如,删除文件名为Indoor User Movement Prediction from RSS Data Set .ipynb的文件
报错信息如下:
$ git rm Indoor\ User\ Movement\ Prediction\ from\ RSS\ Data\ Set\ .ipynb
fatal: pathspec 'Indoor User Movement Prediction from RSS Data Set .ipynb' did not match any files
解决方法:使用""将文件名包含起来,便可删除成功
注:如图所示,引号与文件名之间的空格也要严格对应,否则删除失败,如下图所示
$ git rm " Indoor\ User\ Movement\ Prediction\ from\ RSS\ Data\ Set\ .ipynb"
rm 'code/ Indoor User Movement Prediction from RSS Data Set .ipynb'