Git-ignore certain files in sub-directories, but not all
问题 I have a structure similar to the following: /root/ /root/data/ /root/data/script.php /root/data/some.json /root/data/feature/one.json /root/data/feature/two.json /root/data/other-feature/one.json /root/data/other-feature/important-script.php I'd like git to ignore any .json files under the '/data/...' path, but '/data/' sometimes contains sub-directories. My understanding is that a simple data/*.json in gitignore will only match one directory, as the * doesn't match / , as stated at http:/