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
We tried:
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?
Following gitignore manual page:
So, this clearly stands that there is no way to specify a certain amount of directories between two strings, like between
special
andjs
.Nevertheless, you can have a
.gitignore
file per directory, so maybe in your case the following contentat the following place
would be sufficient?
As of git 1.8.2, this:
Should work according to this answer. It also works for me in Windows 7 using Sourcetree 1.6.12.0 and the version of git that it installs (1.8.4-preview20130916).
To gitignore every file and folder under a directory recursively: