Git报错解决:fatal: pathspec‘fileName' did not match any files

在git-bash窗口中删除文件夹的时候突然出现了这个问题:fatal: pathspec ‘fileName’ did not match any files

产生原因:经过分析该文件夹下有文件存在于.gitignore文件中,因此,不让动!

解决方案:

1、从.gitignore中移除该忽略的文件

2、git add .gitignore文件并git commit至版本库

3、再来删除上述文件,可以正常删除。

原文地址:https://www.cnblogs.com/lvhuayan/p/14537962.html