This is my folder struction:
- Root
- ProgramName
- bin
- Debug
- Backups
- Backup (This folder contains various text files)
- Backups
- Debug
- bin
- ProgramName
I want to ignore the Backups folder and all of it’s files, subfolders, and files in those subfolders.
I don’t want to use Backups/ because if I understand correctly that would match all folders anywhere under the Root directory named Backups.
Right now I have: Debug/Backup in my exclude file, but that’s not working.
You could have .gitignore at any level in hierarchy, rules for concrete directory get gathered from it and all of its parents. So you could place .gitignore with
Backups/in Debug folder.Also you could specify path in root .gitignore that starts with
/, thus matching only your concrete path. So in your case it is/ProgramName/bin/Debug/Backups/If ignore pattern finishes with trailing
/– it will match directories only.