I have a folder in Git with some files in it. Files are part of my Git repository. When my project starts, some working directories appear in this folder. Directories can have any name and any nesting level with several subdirectories. I want to ignore all possible subdirectories appearing in this folder, but still save all the files (not directories) located in the root of my folder.
I tried templates:
/
*/
None of the above gives the desired result. How can I do that?
Many answers explain how to ignore folders with specific names, for example
Git ignore subfolders . But there seems to be no explanation on how to ignore all wild card subfolders.
source
share