Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ignore same file in different folders with .gitignore

Tags:

git

gitignore

How do I use .gitignore to ignore a file that can be in more than one folder, having the same name?

I have

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

What I need is an expression to ignore both file.json in folderA/folderAA and folderB/folderBB without having to use two expressions for each file.

EDIT START
The file is already tracked by git
EDIT END

like image 946
LuisF Avatar asked Oct 30 '15 10:10

LuisF


1 Answers

You can use the ** wildcard to specify any directory

for example: **/file.json

like image 161
Chris Tompkinson Avatar answered Oct 02 '22 04:10

Chris Tompkinson