我正在Subversion中创建我的第一个项目。到目前为止

 branches
 tags
 trunk

我认为我需要马上把分支变成单数,然后重新开始。更新分支是常态。

我一直在trunk中工作,并将内容移动到tag,如下所示。

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特性。我说的对吗?

我是否应该使用svn copy单独的文件?

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 ?

svn copy cp -rf trunk tags/1.0
svn commit -m " create a first tagged version"

当前回答

svn copy http://URL/svn/trukSource http://URL/svn/tagDestination -m "Test tag code" 
  $error[0].Exception | Select-object Data

你所要做的就是改变URL路径。该命令将创建新目录“tagDestination”。如果发生任何错误,第二行将告诉您完整的错误细节。 如果没有创建,则创建svn env变量。 可以检查(Cmd:- set, Powershell:- Get-ChildItem Env:) 默认路径为“C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe”

其他回答

可以用乌龟:

http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-branchtag.html

你是正确的,在标签文件夹中添加文件是不“正确的”。

您已经正确地猜到复制是要使用的操作;它可以让Subversion跟踪这些文件的历史,并且(我认为)更有效地存储它们。

根据我的经验,最好是对整个项目进行复制(“快照”),即根签出位置的所有文件。这样,快照就可以独立存在,作为整个项目在特定时间点状态的真实表示。

这本书的这一部分展示了这个命令通常是如何使用的。

Use:

svn copy http://svn.example.com/project/trunk \
      http://svn.example.com/project/tags/1.0 -m "Release 1.0"

速记:

cd /path/to/project
svn copy ^/trunk ^/tags/1.0 -m "Release 1.0"
svn copy http://URL/svn/trukSource http://URL/svn/tagDestination -m "Test tag code" 
  $error[0].Exception | Select-object Data

你所要做的就是改变URL路径。该命令将创建新目录“tagDestination”。如果发生任何错误,第二行将告诉您完整的错误细节。 如果没有创建,则创建svn env变量。 可以检查(Cmd:- set, Powershell:- Get-ChildItem Env:) 默认路径为“C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe”

As noted by @victor hugo, the "proper" way is to use svn copy. There is one caveat though. The "tag" created that way will not be a true tag, it will be an exact copy of the specified revision, but it will be a different revision itself. So if your build system makes use of svn revision somehow (e.g. incorporates the number obtained with 'svn info' into the version of the product you build), then you won't be able to build exactly the same product from a tag (the result will have the revision of the tag instead of that of the original code).

从设计上看,在svn中没有办法创建真正合适的元标记。