当前位置:首页> 正文

关于不可知的语言:最好的一般SVN忽略模式?

关于不可知的语言:最好的一般SVN忽略模式?

Best general SVN Ignore Pattern?

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

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

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

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


我将在此问题上加上自己的两分钱:

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

格式化用于复制和粘贴:

1
*.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
2
3
4
5
6
7
8
9
10
*.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

基于Burly的忽略模式,我将ReSharper添加到了忽略列表中

格式化用于复制和粘贴:

1
*.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

格式化以提高可读性:

1
2
3
4
5
*.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


我对Visual Studio的忽略模式:

1
*/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.*

格式化以提高可读性

1
2
3
4
5
*/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.*

每次遇到通常不希望在存储库中使用的文件时,都会更新该模式。我相信没有"最佳"模式-它始终取决于您所使用的语言和环境。

此外,您不太可能想到所有可能的"可忽略"文件类型-您将总是遇到一个根本忘记包含的文件类型。这就是为什么在运行时更新模式效果最佳的原因。


Windows用户可能想扔出desktop.ini和thumbs.db。


用于我的Visual Studio项目

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

您可以从此处扩展更多文件类型。


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


Mac用户可能想抛出.DS_Store。另外,如果有开发人员正在使用Emacs或Vim,则可能要添加~~和##。


由于您可能在项目中使用了第三方库和dll,所以我看不出从存储库中阻止* .lib和* .dll的智慧。这些就是要存储在存储库中的东西。


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


对于Eclipse,我使用:

1
2
bin
.*

。*获取所有项目配置。您几乎永远都不想签入"隐藏"目录或文件,但是如果它出现了,您仍然可以svn添加它。


gitignore.io为git提供了可配置的模式。它们提供了可读的列表,您需要重新设置其格式以使用SVN。

例如,请求MicrosoftOffice和Windows返回

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# 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


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

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

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

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


如果使用,则将Resharper添加到混合物中。

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


不要忘记NCrunch临时文件:

1
*.crunchsolution.* *.crunchproject.*

和核心转储(cygwin,Linux)

1
*.stackdump core.*


gitignore.io为git提供了可配置的模式。它们提供了可读的列表,您需要重新设置其格式以使用SVN。

例如,请求MicrosoftOffice和Windows返回

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# 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

展开全文阅读

相关内容