I\'d like to only track certain directories in git in a larger project, where most directories will be excluded and only a few will be tracked. So, I wanted to use
Reviving an old post, in case someone else stumbles on this:
If you want to ignore all folders/files in the current directory, use a leading slash (/*/
for directories or /*
for files); else Git will ignore the pattern recursively, which will cause files in unignored directories to be ignored too...
With that in mind, the !directory/
pattern unignores directories just fine.