I have a folder of files, some of which begin with a certain prefix like "prefix_" and end with a specific extension, like ".txt".
How to I create an entry in .gitignore that will exclude all files that end with ".txt" but do not start with the prefix "prefix_"?
Thanks!
gitignore works from top to bottom. meaning, to do what you want, you have to set the more global rule at top but then add the exception in next lines. Like this:
*.txt
!prefix_*