subversion 应忽略哪些 Visual Studio 文件以最大程度地减少冲突?
我支持许多使用 Subversion 对其工作进行版本控制的 .Net 开发人员,但我们遇到了许多问题,这些问题似乎与 Visual Studio 用于管理项目、进行调试等的附加文件有关。具体来说,这些文件似乎由于它们已经在存储库中而导致了冲突。 我知道如何把它们救出来以及如何处理它们,但我首先需要知道“它们”是什么。
那么,Subversion 可以忽略哪些文件/目录,为什么可以忽略它们?(又名。这些文件的作用是什么?)
这是一个大型的、相当无组织的 ASP.Net 站点,部署该站点是通过。 svn 更新,因此当文件更改时 IIS 动态编译(我认为就是这样)站点所需的文件需要保留在存储库中。
I am supporting a number of .Net developers who are using Subversion to version control their work, but we have been running into a number of issues that seem to revolve around the additional files that Visual Studio uses to manage projects, do debugging, etc. Specifically, it seems that these files are causing conflicts due to the fact that they are already in the repo. I know how to get them out and how to handle them, but I need to know what "they" are first.
So, what are the files/directories that Subversion can ignore, and why can they be ignored?(aka. what do those files do?)
This is a large, rather un-organized ASP.Net site and deploying the site is done via. svn updates, so files needed by IIS to dynamically compile (I think that's what it is) the site as files change needs to be left in the repo.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(11)
另外,如果您使用的是 Visual Studio 2015,则为 .vs 目录。
Also, if you are using Visual Studio 2015 the .vs directory.
我对这个全局忽略模式很幸运:
我正在运行 Resharper 插件,所以你可能可以忽略它。 “.~m2”是我的数据建模者创建的临时文件。
更新:
感谢您的赞成票。 我最近添加了 Mac、Dreamweaver、Python 和其他一些应忽略的 Visual Studio 文件。
另外,如果有人不小心签入了应该被忽略的文件夹或文件,那么您将需要手动从存储库中删除这些文件,然后 SVN 才会再次开始忽略它们。 这是因为存储库中已有的文件将覆盖任何忽略设置。
I have had good luck with this global ignore pattern:
I am running the Resharper plugin, so you can probably ignore that. ".~m2" is for a temporary file my data modeler creates.
Update:
Thanks for the up-vote. I've recently added Mac, Dreamweaver, Python, and a few more Visual Studio files that should be ignored.
Something else, if someone accidentally checks in a folder or file that should be ignored, then you will need to manually remove the files from the repository before SVN will start ignoring them again. This is because files that are already in the repo will override any ignore settings.
旧线程,但我想补充一点,您可以使用 GitHub 上的 gitignore 示例,找到 这里是一个很好的起点。
Old thread, but I want to add that you could use the gitignore example from GitHub, found here, for a good starting point.
@凯文说)。
@Kevin says).
我认为更好的问题是“我应该向 Subversion 添加哪些文件?”
AnkhSVN 2.0 Subversion 集成会向解决方案中的所有项目准确询问这个问题。 (这个问题是SCC规范的关键部分之一。)然后它只会建议添加这些文件。
作为用户,您可以手动添加其他文件(或将建议的某些文件标记为忽略),但这种行为使得您可以轻松地做正确的事情。
大多数其他颠覆客户端无法与真正了解应该添加和不应该添加什么的系统进行对话。 (例如,TortoiseSVN 等外部客户端及其前端只能根据文件扩展名进行猜测)。
I think a better question would be "What files should I add to Subversion?"
The AnkhSVN 2.0 Subversion integration asks exactly this question to all the projects in your solution. (This question is one of the key parts of the SCC specification.) It will then only suggest adding these files.
As user you can add other files manually (or mark some of the files suggested as ignored), but this behavior makes it very easy to do the right thing.
Most other subversion clients don't have the luxury of talking to a system that really understands what should and shouldn't be added. (E.g. External clients like TortoiseSVN and its frontends can just guess based on file extensions).
这是我的 TortoiseSVN 全局忽略:
当您从 Microsoft Visual SourceSafe 转换时,最后 3 个帮助。
Here's my TortoiseSVN global ignore:
The last 3 help when you transition from Microsoft Visual SourceSafe.
AnkhSVN 在仅签入项目所需的文件方面做得很好。
AnkhSVN does a great job of only checking in the files that are necessary to the project.
我也不会签入 .SDF 文件。 它很大,如果丢失,Visual Studio 将重新创建它。 据我所知,这是一个用于 Intellisense 的数据库。
I would also not check in the .SDF file. It's large and Visual Studio will recreate it if it is missing. It is a database used for Intellisense as far as I know.
我可能会说 bin 目录中的任何内容。
I would probably say anything in the bin directory.
除了上面人们建议的那些之外,我经常不得不忽略 *.cache 因为出于某种原因我不知道 Resharper 喜欢将其 .cache 文件放在与我的代码相同的文件夹中从事于。 另外,我认为还没有人提到过 *.pdb。
In addition to the ones people have suggested above, I frequently have to ignore *.cache because for some reason I don't know Resharper likes to put it's .cache files in the same folders as the code I work on. Also, I don't think anyone has mentioned *.pdb yet.