What Visual Studio files should be ignored by subversion to minimize conflicts?

前端 未结 11 2425
醉酒成梦
醉酒成梦 2020-12-22 17:35

I am supporting a number of .Net developers who are using Subversion to version control their work, but we have been running into a number of issues that seem to revolve aro

相关标签:
11条回答
  • 2020-12-22 17:48

    In addition to the ones people have suggested above, I frequently have to ignore *.cache because for some reason I don't know Resharper likes to put it's .cache files in the same folders as the code I work on. Also, I don't think anyone has mentioned *.pdb yet.

    0 讨论(0)
  • 2020-12-22 17:52
    • 'bin' directory is a good start (as @Kevin says).
    • You would do well to ignore the 'obj' directory too.
    • *.suo and *.user would be best left out of source control.
    • *.VisualState.xml is going to be personal choice too.
    • TestResults.xml (if you're using NUnit)
    0 讨论(0)
  • 2020-12-22 17:52

    I think a better question would be "What files should I add to Subversion?"

    The AnkhSVN 2.0 Subversion integration asks exactly this question to all the projects in your solution. (This question is one of the key parts of the SCC specification.) It will then only suggest adding these files.

    As user you can add other files manually (or mark some of the files suggested as ignored), but this behavior makes it very easy to do the right thing.

    Most other subversion clients don't have the luxury of talking to a system that really understands what should and shouldn't be added. (E.g. External clients like TortoiseSVN and its frontends can just guess based on file extensions).

    0 讨论(0)
  • 2020-12-22 18:01
    • bin and obj directories
    • *.user files (MyProject.csproj.user)
    • *.suo files

    Also, if you are using Visual Studio 2015 the .vs directory.

    0 讨论(0)
  • I have had good luck with this global ignore pattern:

    *bin *obj *suo *.user *.tmp *.TMP 
    *resharper* *Resharper* *ReSharper* *.Load *.gpState 
    Thumbs.db *.~m2

    I am running the Resharper plugin, so you can probably ignore that. ".~m2" is for a temporary file my data modeler creates.

    Update: Thanks for the up-vote. I've recently added Mac, Dreamweaver, Python, and a few more Visual Studio files that should be ignored.

    *.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo *.rej *~ #*# .#* .*.swp
    *[Bb]in *obj *suo *resharp* *.user *.tmp *.TMP *Resharper*
    *ReSharper* *.Load *.gpState *.NoLoad  *.~m2 *.dbmdl _notes *.cache
    [Tt]est[Rr]esult [Bb]uild[Ll]og.* *.[Pp]ublish.xml *.[Cc]ache [Tt]humbs.db lint.db
    *.docstates .apdisk [Ll]ogs .DS_Store *.bak *.vs
    

    Something else, if someone accidentally checks in a folder or file that should be ignored, then you will need to manually remove the files from the repository before SVN will start ignoring them again. This is because files that are already in the repo will override any ignore settings.

    0 讨论(0)
  • 2020-12-22 18:02
    • *.bin
    • *.obj
    • *.exe
    • *.dll
    • *.pch
    • *.user
    • *.suo
    • *.tlb
    • TestResults (VSTS unit test directory)
    0 讨论(0)
提交回复
热议问题