conquester conquester - 2 months ago 33
Git Question

.gitgnore file but not when under a specific directory

I have a Java project in which I am ignoring all jar files with the pattern in .gitignore:


However, there are dependency files in the folder dependencies which are jar files but I don't want to exclude them.
How do I setup the .gitignore for this?

Answer Source

You can use a negated pattern to include files that were ignored by a previous pattern:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download