digital
digital

Reputation: 2139

Git ignore all folders apart from

I want to ignore all the files in my folder structure apart from the following conditions:

profiles (and all folders/files recursive)  
sites/xxx (and all folders/files recursive)

Currently my gitignore file looks like:

`*`  
!sites/xxx  
!sites/xxx/modules  
!sites/xxx/modules/*  
!profiles  
!profiles/xxx  
!profiles/xxx/*  

This doesn't allow me to track sites/xxx/modules/new though, is there anyway round this.

Upvotes: 1

Views: 563

Answers (1)

Phil Miller
Phil Miller

Reputation: 38118

Without looking at the manual, I have a vague memory that .gitignore is processed in order, and so the ! lines should come before *.

Upvotes: 1

Related Questions