Consider the following file structure:
RootFolder
The .gitignore in the SubFolder is ignoring the dist folder. Is there any way I can include the dist folder by editing the .gitignore in the RootFolder?
I have like 20 SubFolders with the same .gitignore, it would be wonderful if I am able to do this, instead of going into each SubFolder and edit the gitignore manually to include the dist folders.
The
.gitignore
in theSubFolder
is ignoring thedist
folder. Is there any way I can include thedist
folder by editing the.gitignore
in theRootFolder
?
I misunderstoot that part first and thought it was the exact opposite. To answer this question: No, this won’t be possible.
Gitignore files in subdirectories will always have a higher precedence over those in a parent directory. This is done to allow having generic rules in the root that can be overridden with more specific rules in a subdirectory.
What you could do however is to simply get rid of all those .gitignore
files in the subdirectories. Since you mentioned that they are all the same anyway, you could just remove them completely and put the still-relevant rules in the root’s .gitignore
.