git 本地文件 add commit灰色 不可以提交 Git: The following paths are ignored by one of your .gitignore files:

我这边最提交项目到git的时候,发现有几个文件没提交上去,大概猜测是git的配置文件里,忽略了所有log目录下的文件,这个目录及下面的文件不予提交

git 本地文件 add commit灰色 不可以提交 Git: The following paths are ignored by one of your .gitignore files:

好,找下项目的所有.gitignore配置,看里边有没有把log目录忽略掉,截图里是没有

git 本地文件 add commit灰色 不可以提交 Git: The following paths are ignored by one of your .gitignore files:

那应该就是git全局配置里配置了,怎么查看git的全局配置,git命令:

git config -l

列出的信息里有个core.excludesfile配置,后面就是本地git全局配置文件(这个名字每个人起的都不一样),找到它,打开 

git 本地文件 add commit灰色 不可以提交 Git: The following paths are ignored by one of your .gitignore files:

git 本地文件 add commit灰色 不可以提交 Git: The following paths are ignored by one of your .gitignore files:

看需要,到底要不要保留这个配置,我这里暂时注释掉,因为后边还有其他项目需要过滤这个log目录,所以我这边暂时用完之后要改回去的。

git 本地文件 add commit灰色 不可以提交 Git: The following paths are ignored by one of your .gitignore files:

如果,是命令行,直接add命令就行;如果是开发工具,可能要重启开发工具才可以,我这用的是IDEA ,重启之后显示可以提交了

git 本地文件 add commit灰色 不可以提交 Git: The following paths are ignored by one of your .gitignore files:

 

https://blog.****.net/lingyanpi/article/details/71724282?utm_source=blogkpcl10

这个好像可以直接定位到出问题的配置文件,我没用过,记录下

https://blog.****.net/oncealong/article/details/96446417