How do .gitignore exclusion rules actually work?
/a/b/c/* !foo Seems to work for me (git 1.7.0.4 on Linux). The * is important as otherwise you’re ignoring the directory itself (so git won’t look inside) instead of the files within the directory (which allows for the exclusion). Think of the exclusions as saying “but not this one” rather than “but include this” – … Read more