Q . How to .gitignore files recursively ?

Mithlesh Kumar. asked, Jul 12 ' 2016

I'm trying to avoid the following pattern in my .gitignore file.

MyPrject/WebApp/Scripts/special/*.js
MyPrject/WebApp/Scripts/special/*/*.js
MyPrject/WebApp/Scripts/special/*/*/*.js
MyPrject/WebApp/Scripts/special/*/*/*/*.js
MyPrject/WebApp/Scripts/special/*/*/*/*/*.js
MyPrject/WebApp/Scripts/special/*/*/*/*/*/*.js
MyPrject/WebApp/Scripts/special/*/*/*/*/*/*/*.js

This however didn't work. This is git on Windows. Is there a more concise way to do this without repeating things?

  • git
  • git-ignore

1 Answers

As of git 1.8.2, this:

Since git 1.8.2, Resources/** !Resources/**/*.foo works.

According to your directory structure.

MyPrject/WebApp/Scripts/special/**/*.js

 

Leave a Ansewer