4
说明哪个gitignore规则忽略了我的文件
有什么办法可以查看为什么git会忽略某些文件(即.gitignore文件中的哪个规则导致该文件被忽略)? 想象一下我有这种情况(或更复杂的情况,有数百个文件夹和数十个.gitignore文件: / -.gitignore -folder/ -.gitignore -subfolder/ -.gitignore -file.txt 如果我运行git add folder/subfolder/file.txtgit可能会抱怨它被忽略了: The following paths are ignored by one of your .gitignore files: folder/subfolder/file.txt Use -f if you really want to add them. 有什么方法可以知道在所有可能.gitignore的规则中忽略该文件并显示该规则吗?喜欢: The following paths are ignored by your folder/.gitignore file (line 12: *.txt) folder/subfolder/file.txt Use -f if …