0

Suppose my Code Base is like this:

├── index.php
├── _application
|   ├── controllers
|   └── Views
└── _jobs
    ├── report.js
    ├── report.html
    ├──_foo
    |  ├──001....
    |  ├──002....
    └──_bar
       ├──001....
       ├──002....

Here foo & bar are folders within the jobs folder, and there could be any number of folders, and I don't know their names in advance.

Using GitIgnore, I want to ignore all folders within 'jobs' folder, but not the files that are present there.

I have looked at How to ignore all subfolders in a folder with .gitignore, but the solution given there ignores the files in the job folder as well.

1 Answer 1

1

Add this !/jobs/*.*, it means, don't ignore anything with an extension which means they are files

1
  • Beware if you have files without any extension in their name.
    – iclman
    Commented Mar 19, 2017 at 11:01

Not the answer you're looking for? Browse other questions tagged or ask your own question.