From: Jonathan Gossage Date: Wed, 22 Sep 2010 16:41:01 GMT Subject: Newbie .gitignore problem Message-ID: 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