.gitignore and Visual Studio project: Ignore bin/Debug directory but not bin/Release directory

后端 未结 9 916
一个人的身影
一个人的身影 2021-01-30 03:51

I have a C# Visual Studio project in a git repository. I want to ignore the contents bin/Debug directory but not the contents of the bin/Release\' dire

相关标签:
9条回答
  • 2021-01-30 04:36

    This works for me:

    *.exe
    *.pdb
    *.manifest
    *.cache
    

    If you are using GitHub Desktop as I am using it, you can just right click the file you want to exclude or right click it and exclude by extension:

    This will automatically generate a .gitignore file for you with the code like above. You can download GitHub Desktop here: GitHub Desktop for Windows 64-bit.

    0 讨论(0)
  • 2021-01-30 04:40

    I know it is an old question, but I've decided to share my approach which excludes exactly bin/Debug, bin/Release etc.

    */**/bin/Debug
    */**/bin/Release
    */**/obj/Debug
    */**/obj/Release
    
    0 讨论(0)
  • 2021-01-30 04:46

    This may be slightly off topic, but whenever starting to create a new project, I usually use GitIgnore.IO for creating my initial gitignore file and then I tweek it from there according to my needs.

    0 讨论(0)
提交回复
热议问题