开发者

Why don't these gitignore entries work?

开发者 https://www.devze.com 2023-03-13 03:17 出处:网络
This is my folder struction: Root ProgramName bin Debug Backups Backup (This folder contains various text files)

This is my folder struction:

  • Root
    • ProgramName
      • bin
        • Debug
          • Backups
            • Backup (This folder contains various text files)

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 tha开发者_如何学Ct 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消