You said you want the Output/
pattern to match only under the test/
directory, so in the test/
directory, create a .gitignore
file with the contents:
Output/
If you put this pattern in your top-level .gitignore
file, then it will match in all directories under the top directory.