Git无法删除文件问题:fatal: pathspec 'readme.txt' did not match any files
2018-01-22 18:27
501 查看
在使用Git时,不小心创建了一个不需要的文件,想要删除一个文件时,出现了错误:
fatal: pathspec 'readme.txt' did not match any files
原因是新建的这个文件被列为“被忽略”的文件,不在Git的控制之下。
解决方法: 先add,再添加-f参数进行删除:
$ git add readme.txt $ git rm -f readme.txt
相关文章推荐
- git --- fatal: pathspec 'readme.txt' did not match any files
- git fatal: pathspec 'readme.txt' did not match any files
- fatal: pathspec 'readme.txt' did not match any files
- git rm–r folder fatal:pathspec "" did not match any files
- fatal: pathspec 'readme.txt' did not match any files 解决办法
- git:git add readme.txt报错 pathspec 'readme.txt' did not match any files
- git:git add readme.txt报错 pathspec 'readme.txt' did not match any files
- fatal: pathspec 'readme.txt' did not match any files
- 报错 pathspec '–m' did not match any file(s) known to git.
- git checkout 出错原因 (error: pathspec 'master' did not match any file(s) known to )
- git切换分支报错:error: pathspec 'origin/XXX' did not match any file(s) known to git.
- git checkout 时出现 error: pathspec '是0106' did not match any file(s) known to git.
- pathspec did not match any file known to git
- git 切换回主支时候error: master did not match any file known to
- git切换分支报错:error: pathspec 'origin/XXX' did not match any file(s) known to git.
- git上找不到远程分支,直接切换报错error: pathspec 'origin/XXX' did not match any file(s) known to git.
- Commit failed with error: did not match any file(s) known to git. 解决办法
- Git之如何解决Error:pathspec '/layout/radar_chart.xml' did not match any file(s) known to
- Git使用之(pathspec master did not match any file(s) known to git)
- GIT问题,error:src refspec master does not match any