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

后端 未结 9 917
一个人的身影
一个人的身影 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:34

    Here's what we've been using lately, it removes all resharper generated stuff and some other important things. Note that we don't commit our release directory, so you shouldn't include Release/ in your .gitignore, but to answer your question, you should include Debug/.

    /build/
    *.suo
    *.user
    _ReSharper.*/
    *.sdf
    bin/
    obj/
    Debug/
    Release/
    *.opensdf
    *.tlog
    *.log
    TestResult.xml
    *.VisualState.xml
    Version.cs
    Version.h
    Version.cpp
    

    UPDATE

    Here's a pretty comprehensive example from github:

    • https://github.com/github/gitignore
    • https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

提交回复
热议问题