使用 Subversion 的 ASP.NET 项目(VisualSVN 客户端)- 我应该忽略哪些文件?
我刚刚开始通过 VisualSVN IDE 插件将 Subversion 与 ASP.NET Web 应用程序一起使用。 Visual Studio 自动生成了一堆文件,因此我不想对这些文件进行版本控制,因为它们实际上并不是代码库的一部分,也不需要构建。
有没有人有从 ASP.NET Web 应用程序提交到 Subversion 时应忽略的主要文件的明确列表? 我将如何忽略这些文件。 如果可能的话,我想将其设置为全局,这样我就不必为我编写并创建新存储库的每个 ASP.NET Web 应用程序执行相同的操作。
答案
在下面的答案中提交的要忽略的文件列表,
- bin
- obj
- *.exe
- *.pdb
- *.suo
- _ReSharper.*
- *.user
一般共识似乎是这些应该在创建存储库时基于每个项目。 然后,所有使用存储库的用户都会忽略它们。
I've just started using Subversion with ASP.NET web applications via the VisualSVN IDE plugin. There are a bunch of files which Visual Studio automatically generates so I don't want to version control these since they're not really part of the codebase and not required to build.
Does anyone have a definitive list of the main files that should be ignored when commiting to Subversion from an ASP.NET Web Application? and how would I go about ignoring these files. If possible I'd like to set it globally so that I don't have to keep doing the same thing for every ASP.NET Web Application that I write and create a new repository for.
Answers
A list of files to ignore as submitted in the answers below,
- bin
- obj
- *.exe
- *.pdb
- *.suo
- _ReSharper.*
- *.user
General concensus seems to be that these should be ignored on a per project basis at the creation of the repository. They will then be ignored by all users using the repository.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
不是真正的“明确”,但我总是忽略 .suo 和 .user 文件以及 bin/ 和 obj/ 目录
Not really 'definitive', but I always ignore .suo and .user files and the bin/ and obj/ directories
这是来自 TortoiseSVN 的我的忽略列表。 VisualSVN 需要 TortoiseSVN 并使用其设置。
我没有使用此设置提交任何不需要的(或未提交任何想要的)文件。
Here's my ignore list from TortoiseSVN. VisualSVN requires TortoiseSVN and uses its settings.
I haven't committed any unwanted (or not committed any wanted) files with this setting.
如果您有任何 WCF 服务引用,则只需为每个服务引用包含文件
Reference.cs
和Reference.svcmap
。If you have any WCF service references then you only need to include the files
Reference.cs
andReference.svcmap
for each service reference.Visual Studio 的 AnkhSVN 插件有一个自动忽略的文件列表,并且只会提交所需的文件。
至少我是这么发现的。 我尝试了几次正确设置存储库,但 AnkhSVN 只提交 TortoiseSVn 想要提交的文件的子集。 例如,如果忽略每个构建时重新编译的文件。
The AnkhSVN plugin for Visual Studio has a list of files to ignore automatically and will only commits the files needed.
At least that's how I find it. It's taken me a few attempts at setting up the repository correctly but with AnkhSVN only commits a subset of he files that TortoiseSVn wants to commit. If ignores files recompiled on every Build for example.
根据您的情况,您可能还希望使 Web.config 不受修订控制。 不同的开发人员可能需要不同的网站配置文件。
我建议在存储库中设置一个单独的目录,其中包含网站的参考配置文件,并忽略实际项目目录中的 *.config。
Depending on your situation, you might want to keep the Web.config out of revision control as well. Different developers might require different configuration files for a website.
I'd recommend setting up a separate directory in your repository with a reference configuration file for the website and ignoring *.config on the actual project directory.
此外,为了解决“bin”的区分大小写问题,我必须将 [Bb]in 添加到我的中。 所以我有:
此外,此链接还解释了如何处理特定于项目的排除,以便其他人在检查时仅对同一项目获得相同的排除行为:
http://svnbook.red-bean.com/en/1.1/ch07s02.html
我在 a 上使用了 svn:ignore 属性特定目录以排除复制到其中的一组特定文件(但我仍然希望目录本身位于 svn 中)。
Additionally, to cover case sensitivity issues with "bin", I had to add [Bb]in to mine. So I have:
Also, this link explains how to handle project specific excludes as well so that others get the same exclusion behavior only for the same project when they check it out:
http://svnbook.red-bean.com/en/1.1/ch07s02.html
I used the svn:ignore property on a particular directory to exclude a certain set of files that were copied into there (but I still wanted the directory itself in svn).
使用 VisualSVN 执行初始“将文件添加到存储库”,它会自动忽略您不想要的内容,例如 suo 文件和 bin/obj 文件夹。
Use VisualSVN to do the initial "Add files to repository" and it automagically ignores the stuff you don't want-such as suo files and the bin/obj folders.