Subversion 中的主干、分支和标签是什么?
可能的重复:
“分支”、“标签”和“主干”的真正含义是什么?
Subversion 中的主干、分支和标签是什么?使用它们的最佳实践是什么?
我可以在 Visual Studio 2008 中使用哪些工具用于 Subversion?
Possible Duplicate:
What do “branch”, “tag” and “trunk” really mean?
What is a trunk, branch and tag in Subversion and what are the best practices to use them?
What tools can I use for Subversion in Visual Studio 2008?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
主干是SVN存储库中的开发主线。
分支是开发的副业,旨在进行更大的、实验性的或破坏性的工作,而不会打扰主干版本的用户。 此外,分支还可用于为同一产品的多个版本创建开发线,例如可以将错误修复向后移植到稳定版本中。
最后,标签是突出显示存储库历史中显着修订的标记,通常是“这是作为 1.0 发布的”之类的内容。
请参阅“使用 Subversion 进行版本控制”的 HTML 版本,尤其是 第 4 章:分支和合并 或购买纸质版本(例如从 amazon)深入讨论技术细节。
与其他人一样(例如下面的 Peter Neubauer),作为
/tags
/branches
和/trunk
目录的底层实现只是 传统并且不以任何方式由工具强制执行。 违反这些约定会导致周围的混乱,因为这会破坏其他人访问存储库的习惯和期望。 必须特别注意避免向标签提交新的更改,这些更改应该被冻结。我使用 TortoiseSVN 但没有 Visual Studio 集成。 我一直在第二台显示器上打开“检查修改”对话框,这样我就可以跟踪我接触过的文件。 但请参阅“最佳 SVN 工具”问题,获取更多建议。
The trunk is the main line of development in a SVN repository.
A branch is a side-line of development created to make larger, experimental or disrupting work without annoying users of the trunk version. Also, branches can be used to create development lines for multiple versions of the same product, like having a place to backport bugfixes into a stable release.
Finally, tags are markers to highlight notable revisions in the history of the repository, usually things like "this was released as 1.0".
See the HTML version of "Version Control with Subversion", especially Chapter 4: Branching and Merging or buy it in paper (e.g. from amazon) for an in-depth discussion of the technical details.
As others (e.g. Peter Neubauer below) the underlying implementation as
/tags
/branches
and/trunk
directories is only conventional and not in any way enforced by the tools. Violating these conventions leads to confusion all around, as this breaks habits and expectations of others accessing the repository. Special care must be taken to avoid committing new changes into tags, which should be frozen.I use TortoiseSVN but no Visual Studio integration. I keep the "Check for modifications" dialog open on the second monitor the whole time, so I can track which files I have touched. But see the "Best SVN Tools" question, for more recommendations.
“trunk”、“branches”和“tags”目录是 Subversion 中的约定。 Subversion 不要求您拥有这些目录,也不要求它们指定特殊含义。 然而,这个约定很常见,除非你有充分的理由,否则你应该遵循这个约定。 其他读者提供的书籍链接描述了该约定以及如何使用它。
The "trunk", "branches", and "tags" directories are conventions in Subversion. Subversion does not require you to have these directories nor assign special meaning to them. However, this convention is very common and, unless you have a really good reason, you should follow the convention. The book links that other readers have given describe the convention and how to use it.
David Schmitt 的答案总结得很好,但我认为重要的是要注意,对于 SVN,术语“分支”、“标签”和“主干”没有任何意义。 这些术语纯粹是语义性的,仅影响我们作为系统用户对待这些目录的方式。 人们可以轻松地将它们命名为“main”、“test”和“releases”。 只要使用该系统的每个人都了解如何正确使用每个部分,它们的名称并不重要。
The answer by David Schmitt sums things up very well, but I think it is important to note that, to SVN, the terms 'branch', 'tag', and 'trunk' don't mean anything. These terms are purely semantic and only affect the way we, as users of the system, treat those directories. One could easily name them 'main', 'test', and 'releases.'; As long as everyone using the system understands how to use each section properly, it really doesn't matter what they're called.
开始学习 Subversion 的一个好地方是 http://svnbook.red-bean.com/ 。
就 Visual Studio 工具而言,我喜欢 AnkhSVN,但我还没有尝试过 <还没有一个 href="http://www.visualsvn.com/" rel="nofollow noreferrer">VisualSVN 插件。
VisualSVN 确实依赖 TortoiseSVN,但 TortoiseSVN 也是 Ankh 的一个很好的补充。
A great place to start learning about Subversion is http://svnbook.red-bean.com/.
As far as Visual Studio tools are concerned, I like AnkhSVN, but I haven't tried the VisualSVN plugin yet.
VisualSVN does rely on TortoiseSVN, but TortoiseSVN is also a nice complement to Ankh IMHO.
要在 Visual Studio 2008 中使用 Subversion,请安装 TortoiseSVN 和 AnkhSVN。
To use Subversion in Visual Studio 2008, install TortoiseSVN and AnkhSVN.
主干被认为是您的主要代码库,是主干的分支。 例如,如果您想实现新功能,但又不想影响主干,则可以创建一个分支。
TortoiseSVN 有很好的文档和一个很棒的 diff 工具。
我使用 Visual studio,并使用 VisualSVN 和 TortoiseSVN。
A trunk is considered your main code base, a branch offshoot of the trunk. Like, you create a branch if you want to implement a new feature, but don't want to affect the main trunk.
TortoiseSVN has good documentation, and a great diff tool.
I use Visual studio, and I use VisualSVN and TortoiseSVN.
如果您是 Subversion 新手,您可能需要适当地查看 SmashingMagazine.com 上的这篇文章
标题为终极版使用 SubVersion 进行版本控制的综述。
它涵盖了 SubVersion 入门以及教程、参考资料和文档的链接。 书籍建议。
它涵盖了工具(许多是兼容的窗口),并提到 AnkhSVN 作为 Visual Studio 兼容插件。 评论还提到 VisualSVN 作为替代方案。
If you're new to Subversion you may want to check out this post on SmashingMagazine.com, appropriately
titled Ultimate Round-Up for Version Control with SubVersion.
It covers getting started with SubVersion with links to tutorials, reference materials, & book suggestions.
It covers tools (many are compatible windows), and it mentions AnkhSVN as a Visual Studio compatible plugin. The comments also mention VisualSVN as an alternative.
如果您有一个开发团队,那么SVN Monitor 是一个很棒的免费实用程序。 它充当您的树的心跳,告诉您何时有更新、可能的冲突等。但对于独立开发人员来说,它不太有用。
A fantastic free utility to use if you have a team of developers is SVN Monitor. It serves as a heartbeat for your tree, telling you when there are updates, possible conflicts, etc. It's not quite as useful for a solo developer though.
关于 Subversion 的一本好书是 使用 Subversion 进行实用版本控制 解释了您的问题,并提供了更多信息。
A good book on Subversion is Pragmatic Version Control using Subversion where your question is explained, and it gives a lot more information.