I have a folder in Git with some files in it. Files are a part my Git repository. When running my project some work directories appear in this folder. Directories can have any n
It's quite simple. Create the .gitignore in the folder with:
.gitignore
*/*
I.e. ignore all files which are in any folder of the current folder.
Try this:
!folder/ folder/*
The first line excludes the top level from being ignored, and the second line ignores all subfolders.