See this stackoverflow question. Basically
/* !/dir1 !/dir2
will ignore everything except for dir1 and dir2.
dir1
dir2