如何从主干正确创建 SVN 标签? [英] How to properly create an SVN tag from trunk?
问题描述
我正在 Subversion 中创建我的第一个项目.到目前为止,我有
I am creating my first project in Subversion. So far I have
branches
tags
trunk
我想我立即需要使分支变得单一并重新开始.更新分支是常态.
I think I immediately need to make branches singular and start over. Update branches is the norm.
我一直在做trunk的工作并将内容移动到标签中,如下所示.
I have been doing work in trunk and moving the contents to tags as follows.
mkdir tags/1.0
cp -rf trunk/* tags/1.0
svn add tags/1.0
svn commit -m " create a first tagged version"
我的直觉告诉我这是完全错误的,我应该使用 svn copy
来维护文件之间的某种关系.我以这种方式创建的文件彼此之间没有关系,而且我肯定会错过 Subversion 的功能.我说的对吗?
My gut tells me this is totally wrong, and I should maintain some relationship between the files using svn copy
. The files I create in this way will have no relationship to each other, and I am sure I will miss out on Subversion features. Am I correct?
我应该对单个文件使用 svn copy 吗?
Should I use svn copy for the individual files?
mkdir tags/1.0
svn add tags/1.0
svn copy trunk/file1 tags/1.0
svn copy trunk/file2 tags/1.0
svn copy trunk/file3 tags/1.0
svn commit -m " create a first tagged version"
我应该在整个目录上使用 svn copy 吗?
Should I use svn copy on the entire directory?
svn copy cp -rf trunk tags/1.0
svn commit -m " create a first tagged version"
推荐答案
您是对的,将文件添加到标签文件夹是不正确的".
You are correct in that it's not "right" to add files to the tags folder.
您已经正确地猜到了 copy
是要使用的操作;它让 Subversion 可以跟踪这些文件的历史记录,并且(我假设)还可以更有效地存储它们.
You've correctly guessed that copy
is the operation to use; it lets Subversion keep track of the history of these files, and also (I assume) store them much more efficiently.
根据我的经验,最好复制整个项目(即来自根签出位置的所有文件)的副本(快照").这样,快照就可以独立存在,作为整个项目在特定时间点的状态的真实表示.
In my experience, it's best to do copies ("snapshots") of entire projects, i.e. all files from the root check-out location. That way the snapshot can stand on its own, as a true representation of the entire project's state at a particular point in time.
这部分书"显示通常如何使用命令.
This part of "the book" shows how the command is typically used.
这篇关于如何从主干正确创建 SVN 标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!