Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
949 views
Welcome To Ask or Share your Answers For Others

1 Answer

As of git 1.8.2, this:

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

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:

MyPrject/WebApp/Scripts/special/**

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...