See [this stackoverflow question](https://stackoverflow.com/questions/23301107/how-can-i-include-only-specific-folders-in-git-using-gitignore). Basically ``` /* !/dir1 !/dir2 ``` will ignore everything except for `dir1` and `dir2`.