最好的通用 SVN 忽略模式?

发布于 2024-07-06 00:41:59 字数 260 浏览 10 评论 0原文

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

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

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

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

What is the best (or as good as possible) general SVN ignore pattern to use?

There are a number of different IDE, editor, compiler, plug-in, platform, etc. specific files and some file types that "overlap" (i.e. desirable for some types projects and not for others).

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.

The answer to this question would serve as a good starting point for any project - only requiring them to add the few environment specific items they need. It could be adapted for other Version Control Systems (VCS) as well.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(17

温柔戏命师 2024-07-13 00:41:59

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

Visual Studio (VC++) users definitely need to exclude the .ncb files

腻橙味 2024-07-13 00:41:59

基于 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

Based on Burly's ignore pattern, I have added ReSharper to the ignore list

Formatted for copy and paste:

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

Formatted for readability:

*.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
醉酒的小男人 2024-07-13 00:41:59

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

My ignore pattern for 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.*

Formatted for readability

*/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.*
屋檐 2024-07-13 00:41:59

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

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

Every time I come across a file I generally do not want in the repository, I update the pattern. I believe there is no "best" pattern - it always depends on the language and environment you develop in.

Moreover, you're not very likely to think of all the possible "ignorable" filetypes - you'll always encounter a filetype you simply forgot to include. Thats why updating the pattern as you go works the best.

夏见 2024-07-13 00:41:59

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

Windows users might want to throw in desktop.ini and thumbs.db.

埖埖迣鎅 2024-07-13 00:41:59

用于我的 Visual Studio 项目

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

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

Used for my Visual Studio projects

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

You can expand more file types from there.

心凉 2024-07-13 00:41:59

我将对此问题添加我自己的两分钱:

我将以下 SVN 忽略模式与 TortoiseSVN 和 Subversion CLI 用于 Windows 和 Linux 平台上的本机 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

I'll add my own two cents to this question:

I use the following SVN ignore pattern with TortoiseSVN and Subversion CLI for native C++, C#/VB.NET, and PERL projects on both Windows and Linux platforms. It works well for me!

Formatted for copy and paste:

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

Formatted for readability:

*.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
终难愈 2024-07-13 00:41:59

如果您使用 Resharper,则必须将其添加到其中。

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

Gotta add Resharper to the mix if you use one.

another one to look out for is Ankh*.*

柠檬色的秋千 2024-07-13 00:41:59

不要忘记 NCrunch 临时文件:

*.crunchsolution.* *.crunchproject.*

Don't forget NCrunch temporary files:

*.crunchsolution.* *.crunchproject.*
灵芸 2024-07-13 00:41:59

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

在 Linux 上,您首先需要阻止 **.o*、**.so*、**.a* 和 **.la*。 您可能还想阻止***~*(防止编辑备份文件)和#*#(防止 emacs 崩溃备份)。

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

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

The pattern depends on which operating system you're using.

On Linux, you'll want to block **.o*, **.so*, **.a*, and **.la* to begin with. You may also want to block **~* (backup file from editing) and #*# (emacs backup from a crash).

On Windows, you'll want **.obj*, **.lib*, and **.dll* at the very least.

Any other files you need to block depend on your IDE, editor, and compiler.

此刻的回忆 2024-07-13 00:41:59

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

Visual Studio 2010 users should add ipch (a folder which contains C++ precompiled headers) and *.sdf (huge files used by intellisense for any kind of project).

梦毁影碎の 2024-07-13 00:41:59

由于您可能使用第三方库和 dll 作为项目的一部分,因此我认为从存储库中阻止 *.lib 和 *.dll 并不明智。 这些是要存储在存储库中的内容。

Since you may be using third party libs and dll's as part of the project(s) then I don't see the wisdom in blocking *.lib and *.dll from the repository. These are the things that are meant to be stored in the repository.

幸福还没到 2024-07-13 00:41:59

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

Mac users probably want to throw in .DS_Store. In addition, if there are dev's using Emacs or Vim, you probably want to add ~~ and ##.

勿忘心安 2024-07-13 00:41:59

对于 Eclipse,我使用:

bin
.*

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

For Eclipse, I use:

bin
.*

.* gets all the project configuration. You almost never want to check in a 'hidden' directory or file, but if it comes up, you can still svn add it.

念﹏祤嫣 2024-07-13 00:41:59

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

例如,请求 MicrosoftOffice 和 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

gitignore.io provides configurable patterns for git. They provide a readable list, which you need to reformat for SVN.

For instance, requesting MicrosoftOffice and Windows returns

# 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
尴尬癌患者 2024-07-13 00:41:59

和核心转储(cygwin、linux)

*.stackdump core.*

And core dumps (cygwin, linux)

*.stackdump core.*
故人爱我别走 2024-07-13 00:41:59

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

例如,请求MicrosoftOffice和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:全局忽略

gitignore.io provides configurable patterns for git. They provide a readable list, which you need to reformat for SVN.

For instance, requesting MicrosoftOffice and Windows returns

# 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

It seems that it can be directly used as svn:global-ignore

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文