Moritz Herbert
Moritz Herbert

Reputation: 411

How to ignore all dist folders except the one?

we do have a few folders in our projects called dist. These shall be ignored by git. On the other hands just putting dist/ into the .gitignore file does have side effects when using bower, since the dist folders within bower_components/ are ignored as well.

Any suggestions on how to correctly define a rule, that ignore dist folders except the ones within bower_components?

Upvotes: 8

Views: 12912

Answers (1)

Vampire
Vampire

Reputation: 38724

Sure:

dist/
!bower_components/**/dist/

Upvotes: 18

Related Questions