使用.gitignore忽略不同文件夹中的相同文件

Lui*_*isF 4 git gitignore

如何使用.gitignore忽略一个文件,该文件可以位于多个文件夹中且具有相同的名称?

我有

-folderA -folderAA -file.json -folderB -folderBB -file.json

我需要的是忽略既是表达file.jsonfolderA / folderAAFolderB中/ folderBB,而无需使用两个表达式为每个文件。

EDIT START
该文件已经被git EDIT END跟踪