For various reasons, I have the entry in my .gitignore
in the root of a project:
*.c
As I desire, this ignores all C files from being included. However, I really only want the C files to only be ignored in the root directory, and not all the sub-directories:
foo.c
bar.c
folder/baz.c
In the above scheme, I only want foo.c and bar.c ignored. I do not want this gitignore rule to work recursively. How do I do this?
I'm aware of being able to negate the rule with !*.c
, but I'd rather not do that for every subdirectory. (This is what I am currently doing).