Newbie .gitignore problem
- From
- Jonathan Gossage <jgossage@gmail.com>
- Date
- Sep 22, 2010, 16:41 UTC
- Message-ID
- <AANLkTin=BwgjqWQ3NfNdL9a1fUnVnFMrmAsmnZjHS=gL@mail.gmail.com>
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