最好的一般SVN忽略模式?

时间:2008-09-17 16:59:24

标签: svn language-agnostic version-control development-environment environment

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

有许多不同的IDE,编辑器,编译器,插件,平台等特定文件和一些“重叠”的文件类型(即某些类型项目需要而不适用于其他类型)。

但是,无论开发环境的具体情况如何,您都不会自动将大量文件类型自动包含在源代码管理中。

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

17 个答案:

答案 0 :(得分:191)

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

我在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

答案 1 :(得分:44)

根据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

答案 2 :(得分:34)

我对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.*

答案 3 :(得分:17)

每当我遇到一个文件时,我通常不想在存储库中,我更新模式。我相信没有“最佳”模式 - 它总是取决于你所开发的语言和环境

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

答案 4 :(得分:12)

Windows用户可能想要使用desktop.ini和thumbs.db。

答案 5 :(得分:4)

用于我的Visual Studio项目

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

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

答案 6 :(得分:3)

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

答案 7 :(得分:1)

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

答案 8 :(得分:1)

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

答案 9 :(得分:1)

对于Eclipse,我使用:

bin
.*

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

答案 10 :(得分:1)

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

答案 11 :(得分:0)

模式取决于您正在使用的操作系统。

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

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

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

答案 12 :(得分:0)

如果您使用Resharper,请添加Resharper。

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

答案 13 :(得分:0)

不要忘记NCrunch临时文件:

*.crunchsolution.* *.crunchproject.*

答案 14 :(得分:0)

核心转储(cygwin,linux)

*.stackdump core.*

答案 15 :(得分:0)

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

答案 16 :(得分:0)

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

相关问题