Meson projects using Meson subprojects have a project directory structure like:
meson.build main.c subprojects/ lapack/ lapack.wrap
where “subprojects/lapack/” is automatically created as a Meson subproject from the metadata in “subprojects/lapack.wrap”. Using the negate .gitignore syntax Git will ignore subdirectories but track the subprojects/*.wrap files:
include in the project .gitignore:
This technique can be applied to similar non-Meson scenarios.