I have a folder named packages in my git repo, I want to ignore everything inside that folder except for files with targets extension. I've tried this in my gitignore:
packages/
!packages/**/*.targets
but it doesn't work.
How do I ignore that folder but not the targets files?
This seems to work for me (Git 1.8.2.1):
packages/**/*.*
!packages/**/*.targets
I needed the *.*
part, otherwise **
matches 0 directories, and a lone *
at the end will match any directory inside packages, practically ignoring every directory, and any file inside.
I hope the *.*
is not too bad for you, but having files without extension is pretty uncommon.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With