如何为SVN组织项目目录? [英] How to organize project directories for SVN?

查看:37
本文介绍了如何为SVN组织项目目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 SVN 的新手.我应该如何在我的计算机上组织项目目录结构(不在 REPOSITORY 中)?它应该与存储库中的相同(主干、标签、分支)还是通常使用不同的结构?谢谢.

I am new to SVN. How should I organize the project directory structure on my computer (NOT in REPOSITORY)? Should it be the same as in the repository (trunk, tags, branches) or is it usual to use a different structure? Thanks.

推荐答案

我倾向于使用的格式是只签出我需要的分支、标签或主干.如果出于某种原因需要,我当然可以多次检查多个分支,甚至多次检查同一个分支.

The format I tend to use is to checkout just the branch, tag or trunk that I need. I can of course, checkout multiple braches, or even the same branch multiple times if I need to for some reason.

我不会检查整个项目的主干分支和标签——这太不正常了.我喜欢鼓励多个分支进行实验和工作,并在每一个机会标记.当我对 <1% 的内容感兴趣时将所有这些都搁置下来只会浪费每个人的时间.

I don't checkout the entire project's trunk branches and tags - that's just perverse. I like to encourage multiple branches for experimentation and work, as well as tags at every opportunity. Bringing all of this down when I'm interested in <1% of them would just be a waste of everyone's time.

为简单起见,我倾向于将所有这些工作副本放在同一个文件夹中,命名以便我可以识别它们:

For simplicity, I tend to put all of these working copies in the same folder, named so that I can identify them:

例如:

c:\development
          \EmergencyFix-UICrash-V1.8
          \Refactoring-ServerComponent
          \NewCustomerUI

在每个工作副本下,它是存储库中出现的分支的直接副本.重要的是,您可以只检出一个分支并在磁盘上的工作副本中拥有正确的结构.如果您必须手动移动东西,或将东西复制到特定位置,或将不同的东西检查到不同的位置,那么大量构建信息将与源代码分开携带(通常只在您的头脑中,维护恶梦!).将它们放在一起,让您的源代码控制工具为此承担繁重的工作,您可能有机会控制您的构建.

Under each working copy, it's a straight copy of the branch as it appears in the repository. It's important that you can just checkout a branch and have the correct structure in the working copy on your disk. If you have to manually move things around, or copy things to specific locations, or check different things out to different locations, then that's a lot of build information being carried around separate to your source code (and it's usually only in your heads, maintenance nightmare!). Keep it all together, let your source control tool do the heavy lifting for this and you might stand a chance of getting control over your builds.

如果你真的无法忍受镜像分支结构的工作副本,可以利用 svn:externals 以可控的方式缩小差距.虽然我知道有些人认为它们是一种反模式,但我觉得它们在以理智的方式使用时提供了一种宝贵而强大的选择.

If you really can't live with the working copy mirroring the branch's structure, svn:externals can be leveraged to close the gap in a controllable manner. Whilst I know some feel that they're an anti-pattern, I feel they offer an invaluable and powerful option when used in a sane manner.

但是要注意......有一个工作副本是混合了两打其他存储库检出的,没有一个可以保证在多个位置稳定定义,并且更改不可预测的随机子目录并没有以理智的方式使用外部......

But be warned ... having a working copy that's a mix of two dozen other repository checkouts, none of which are guaranteed stable defined at multiple locations and changing unpredictable random subdirectories isn't using externals in a sane manner ...

这篇关于如何为SVN组织项目目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆