I am having a problem specifying .gitignore filters properly I have a directory structure as follows:     Ârepo-root        |        -------------------------------------------------------------------        |          Â|      |       Âdir1        dir2 Â(symlink)       Âdir3                  Â|        Â---------------------------------------------------        |                          |     Âmany directories and files        dir4 My problem is that I want to exclude all files and sub-directories in dir2 except for dir4 from control by Git. I tried a number of variations on the following .gitignore file in dir2 but either everything was excluded or everything was included. I tested using git add -uall -n The final .gitignore file was * */* !dir4 How should I go about tackling this. The .gitignore man pages were unclear to me. Jonathan Gossage ÿô.nÇ·®+%˱é¥wÿº{.nÇ· ßØnr¡öë¨è&£ûz¹Þúzf£¢·h§~Ûÿÿïÿê_èæ+v¨þ)ßø