I'm looking for a way to ignore files in git that have a certain path in their file. These are XML files that are all stored together, but some reference folders that are in .gitignore. I want to exclude the XML files that reference these folders.
Is this possible purely with .gitignore? I can imagine other ways to achieve this, like force keeping these files with a script, but that would not be favorable.