Possible Duplicate:
Make .gitignore ignore everything except a few files
Is it possible to let git ignore all files by default, unless specified in a special file?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can include !-lines to whitelist files: a .gitignore with:
will exclude all, but the ‘included/’ directory
Note that if you want files matching a pattern to be un-ignored, in subdirectories, you will need to prevent the containing directories from getting ignored too. This should not pose a large problem, since git doesn’t actually track directories, only files (identified by a repository path).
Example:
will ignore everything, except
SOURCESin subdirectories.