0

How can I unignore every folder with name config? Recursively

For example I want to put my / under git. I put * in .gitignore to ignore everything. Now I want unignore folders and subfolders and subsubfolders... with name config.

Suppose I don't know full path to this config folders. I want something like: !**/config/**, but it doesn't work.

my .gitignore:

*
!**/config/**

May be someone suggests another way to do it?

c0rp
  • 501
  • 1
  • 10
  • 31
  • 1
    possible duplicate of [How do gitignore exclusion rules actually work?](http://stackoverflow.com/q/3001888/1256452) (note in particular the last answer, that says that a directory is not even opened if it's already excluded). – torek Jan 15 '14 at 10:27

1 Answers1

0

Try this in your .gitignore:

*
!config/

You don't have to use asterisks to tell Git to work recursively.