Svn 简明教程

SVN - Tags

版本控制系统通过使用可以对特定版本的代码指定有意义的名称的概念来支持标签操作。标签允许为特定版本的代码提供描述性和易记性。例如, BASIC_ARRAY_OPERATIONSrevision 4 更容易记住。

Version Control System supports the tag operation by using that concept that one can give meaningful name to a specific version of the code. Tag allows to give descriptive and memorable names to specific version of code. For example BASIC_ARRAY_OPERATIONS is more memorable than revision 4.

让我们通过一个示例来看看标签操作。Tom 决定创建一个标签,以便他可以更轻松地访问代码。

Let us see tag operation with an example. Tom decides to create a tag so that he can access the code more easily.

[tom@CentOS project_repo]$ svn copy --revision=4 trunk/ tags/basic_array_operations

上述命令将产生以下结果。

Above command will produce the following result.

A    tags/basic_array_operations/array.c
Updated to revision 4.
A         tags/basic_array_operations

成功完成后,将在 tags 目录内创建一个新目录。

Upon successful completion, the new directory will be created inside the tags directory.

[tom@CentOS project_repo]$ ls -l tags/
total 4
drwxrwxr-x. 3 tom tom 4096 Aug 24 18:18 basic_array_operations

Tom 在提交之前希望再次检查一下。状态操作显示标签操作成功,因此他可以安全地提交自己的更改。

Tom wants to double-check it before commit. Status operation is showing that the tag operation is successful, so he can safely commit his changes.

[tom@CentOS project_repo]$ svn status
A  +    tags/basic_array_operations

[tom@CentOS project_repo]$ svn commit -m "Created tag for basic array operations"
Adding         tags/basic_array_operations

Committed revision 5.