171

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

有许多不同的IDE,编辑器,编译器,插件,平台等具体文件和某些文件类型的“重叠”(即希望某些类型的项目,不是为别人)。

然而,有大量的文件类型,你永远不想自动包含在源代码管理中,而不管你的开发环境的具体细节如何。

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

+0

您好扎克,我一直在阅读这篇文章你的:HTTP://www.zachburlingame。 com/2011/03 /安装 - mercurial-and-hosting-repositories-with-centos /和我有几个问题..有没有办法与你联系?感谢您的时间... P.S:找不到任何其他方式与您联系,除非通过这里的评论,对于烦恼抱歉 – Brams 2014-07-09 08:56:20

回答

190

我将我自己的两分钱添加到这个问题:

我使用以下的SVN忽略在TortoiseSVN和Subversion的CLI本地C++,在Windows和Linux下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 
+0

@blorgbeard - 我回滚你的格式更改,因为我相信最好将它全部放在一行上,以便复制/粘贴到SVN配置文件(不接受多行输入)。 – 2009-07-12 16:25:13

+0

调整它。 – 2009-07-17 17:11:08

+5

* .tmp * .temp呢? – 2009-07-17 17:15:09

4

用于我的Visual Studio项目

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

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

+0

我今天早些时候看到类似的列表 - */bin和just bin之间的区别是什么?假设你想忽略整个文件夹。 – harpo 2008-09-17 17:03:28

+0

阅读第5.13节。忽略TortoiseSVN帮助文件的文件和目录。 – icelava 2008-09-18 14:31:22

+5

http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-ignore.html 那里它说,你不应该包括一个/或\,包括他们是早期版本的遗产 – 2009-07-09 15:33:42

12

Windows用户可能希望在的desktop.ini和的Thumbs.db扔。

3

的Visual Studio(VC++)的用户一定要排除.NCB文件

17

每当我遇到一个文件我一般不希望在仓库,我更新的模式。我相信没有“最好”的模式 - 它总是取决于你开发的语言和环境

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

1

Mac用户可能需要在.DS_Store扔。此外,如果有Dev的使用Emacs或Vim的,你可能要添加〜〜#和#

0

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

在Linux上,您需要先封锁**。o *,**。so *,**。a *和**。la *。您可能还想阻止**〜*(来自编辑的备份文件)和#*#(来自崩溃的emacs备份)。

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

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

1

对于Eclipse,我用:

bin 
.* 

*得到所有的项目配置。你几乎从不想检入一个“隐藏的”目录或文件,但如果它出现,你仍然可以添加它。

1

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

44

基于魁梧的忽略模式,我加入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 
33

我忽略模式的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

得,如果你使用一个添加ReSharper的的组合。

另外一个看出来的是安赫*。*

1

Visual Studio 2010个的用户应该添加ipch(用于任何类型的项目使用智能感知大文件)(一个包含C++预编译头文件夹),*.sdf

0

不要忘记NCrunch临时文件:

*.crunchsolution.* *.crunchproject.* 
0

和核心转储(Cygwin的,LINUX)

*.stackdump core.* 
0

gitignore.io提供可配置模式的饭桶。他们提供了一个可读的列表,您需要重新格式化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 
0

gitignore.io提供可配置模式的饭桶。他们提供了一个可读的列表,您需要重新格式化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