> 'foo*' removes the whole tree The more accurate "foo foo/*" should be used instead of "foo*" because the latter also matches "foobar". I added the part of these suggestions not related to Files-Excluded to #688481.