首页 文章

最好的一般SVN忽略模式?

提问于
浏览
171

使用一般SVN忽略模式的最佳(或尽可能好)是什么?

存在许多不同的IDE,编辑器,编译器,插件,平台等特定文件和一些“重叠”的文件类型(即某些类型项目而不是其他类型的项目) .

There are however, a large number of file types that you just never want included in source control automatically regardless the specifics of your development environment.

这个问题的答案可以作为任何项目的良好起点 - 只要求他们添加他们需要的少数环境特定项目 . 它也可以适用于其他版本控制系统(VCS) .

17 回答

  • 0

    我会在这个问题上加上我自己的两分钱:

    我在Windows和Linux平台上对TortoiseSVN和Subversion CLI使用以下SVN忽略模式,用于本机C,C#/ VB.NET和PERL项目 . 这对我来说很有效!

    格式化复制和粘贴:

    *.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* .DS_Store thumbs.db Thumbs.db *.bak *.class *.exe *.dll *.mine *.obj *.ncb *.lib *.log *.idb *.pdb *.ilk *.msi* .res *.pch *.suo *.exp *.*~ *.~* ~*.* cvs CVS .CVS .cvs release Release debug Debug ignore Ignore bin Bin obj Obj *.csproj.user *.user *.generated.cs
    

    格式化可读性:

    *.o *.lo *.la #*# .*.rej *.rej
    .*~ *~ .#* .DS_Store thumbs.db 
    Thumbs.db *.bak *.class *.exe *.dll
    *.mine *.obj *.ncb *.lib *.log 
    *.idb *.pdb *.ilk *.msi* .res *.pch *.suo 
    *.exp *.*~ *.~* ~*.* cvs  CVS .CVS .cvs  
    release Release debug Debug
    ignore Ignore bin Bin obj  Obj
    *.csproj.user *.user
    *.generated.cs
    
  • 33

    根据Burly的忽略模式,我将ReSharper添加到忽略列表中

    格式化复制和粘贴:

    *.o *.lo .la ## .*.rej .rej .~ ~ .# .DS_Store thumbs.db Thumbs.db *.bak *.class *.exe *.dll *.mine *.obj *.ncb *.lib *.log *.idb *.pdb *.ilk .msi .res *.pch *.suo *.exp ~. cvs CVS .CVS .cvs release Release debug Debug ignore Ignore bin Bin obj Obj *.csproj.user *.user _ReSharper.* *.resharper.user
    

    格式化可读性:

    *.o *.lo .la ## .*.rej .rej .~ ~ .# .DS_Store thumbs.db Thumbs.db *.bak
    *.class *.exe *.dll *.mine *.obj *.ncb *.lib *.log *.idb *.pdb *.ilk .msi .res *.pch *.suo *.exp ~. cvs
    CVS .CVS .cvs release Release debug
    Debug ignore Ignore bin Bin obj Obj
    *.csproj.user *.user _ReSharper.* *.resharper.user
    
  • 0

    我对Visual Studio的忽略模式:

    */bin */obj */Release */Debug *.suo *.err *.log *.obj *.bin *.dll *.exe *.LOG *.user *.pdb [tT]emp [tT]empPE Ankh.Load thumbs.db *.resharper *.vspscc *.vsssccc *.scc */_ReSharper* */_ReSharper.* bin obj *.resharperoptions *.db *.bak *_ReSharper* *.snk logs output TestResults *.crunchsolution.* *.crunchproject.*
    

    格式化以提高可读性

    */bin */obj */Release */Debug *.suo *.err *.log *.obj *.bin *.dll *.exe 
    *.LOG *.user *.pdb [tT]emp [tT]empPE Ankh.Load thumbs.db *.resharper 
    *.vspscc *.vsssccc *.scc */_ReSharper* */_ReSharper.* bin obj 
    *.resharperoptions *.db *.bak *_ReSharper* *.snk logs output TestResults 
    *.crunchsolution.* *.crunchproject.*
    
  • 0

    每次我遇到一个文件,我通常不想在存储库中,我更新模式 . 我相信没有"best"模式 - 它始终是你发展的 .

    而且,你不太可能想到所有可能的“可忽略的”文件类型 - 你总会遇到一个你忘记包含的文件类型 . 这就是为什么在你去的时候更新模式效果最好 .

  • 0

    Windows用户可能想要输入desktop.ini和thumbs.db .

  • 1

    用于我的Visual Studio项目

    */bin */obj *.user *.suo
    

    您可以从那里扩展更多文件类型 .

  • 0

    Visual Studio(VC)用户肯定需要排除 .ncb 文件

  • 44

    Mac用户可能想要投入.DS_Store . 另外,如果有开发人员使用Emacs或Vim,你可能想添加~~和## .

  • 190

    对于Eclipse,我使用:

    bin
    .*
    

    . *获取所有项目配置 . 您几乎从不想要检查“隐藏”目录或文件,但如果它出现,您仍然可以添加它 .

  • 1

    由于您可能正在使用第三方库和dll作为项目的一部分,因此我没有看到从存储库中阻止* .lib和* .dll的智慧 . 这些是要存储在存储库中的内容 .

  • 0

    Visual Studio 2010用户应添加 ipch (包含C预编译头文件夹的文件夹)和 *.sdf (intellisense用于任何类型项目的大文件) .

  • 17

    该模式取决于您使用的操作系统 .

    在Linux上,你要阻止** . o * . so * . a * . la 开头 . 您可能还想阻止*〜(编辑备份文件)和##(崩溃时的emacs备份) .

    在Windows上,你至少需要** .obj * . lib * . dll * .

    您需要阻止的任何其他文件取决于您的IDE,编辑器和编译器 .

  • 1

    如果您使用Resharper,请将其添加到混合物中 .

    另一个要注意的是Ankh * . *

  • 4

    别忘了NCrunch临时文件:

    *.crunchsolution.* *.crunchproject.*
    
  • 1

    和核心转储(cygwin,linux)

    *.stackdump core.*
    
  • 3

    gitignore.io为git提供可配置的模式 . 它们提供了一个可读列表,您需要重新格式化SVN .

    例如,requesting MicrosoftOffice and Windows返回

    # Created by https://www.gitignore.io/api/microsoftoffice,windows
    
    ### MicrosoftOffice ###
    *.tmp
    
    # Word temporary
    ~$*.doc*
    
    # Excel temporary
    ~$*.xls*
    
    # Excel Backup File
    *.xlk
    
    # PowerPoint temporary
    ~$*.ppt*
    
    # Visio autosave temporary files
    *.~vsdx
    
    
    ### Windows ###
    # Windows image file caches
    Thumbs.db
    ehthumbs.db
    
    # Folder config file
    Desktop.ini
    
    # Recycle Bin used on file shares
    $RECYCLE.BIN/
    
    # Windows Installer files
    *.cab
    *.msi
    *.msm
    *.msp
    
    # Windows shortcuts
    *.lnk
    
  • 12

    gitignore.io为git提供可配置的模式 . 它们提供了一个可读列表,您需要重新格式化SVN .

    例如,requesting MicrosoftOffice and Windows返回

    # Created by https://www.gitignore.io/api/microsoftoffice,windows
    
    ### MicrosoftOffice ###
    *.tmp
    
    # Word temporary
    ~$*.doc*
    
    # Excel temporary
    ~$*.xls*
    
    # Excel Backup File
    *.xlk
    
    # PowerPoint temporary
    ~$*.ppt*
    
    # Visio autosave temporary files
    *.~vsdx
    
    
    ### Windows ###
    # Windows image file caches
    Thumbs.db
    ehthumbs.db
    
    # Folder config file
    Desktop.ini
    
    # Recycle Bin used on file shares
    $RECYCLE.BIN/
    
    # Windows Installer files
    *.cab
    *.msi
    *.msm
    *.msp
    
    # Windows shortcuts
    *.lnk
    

    它似乎可以直接用作 svn:global-ignore

相关问题