Naturally, there’s a way around this.
.gitignore file within the subdirectory and add these lines:
# Ignore everything inside this subdirectory... * # ...except for this file !.gitignore
As the comments detail, the first line tells Git to ignore everything inside the directory except for the
.gitignore file itself.