问题描述
如何创建分支?
有人可以向我解释这些语法吗?
How to create a branch?
Could anyone explain these syntax to me?
c版本中显示所有元素
- display all elements in their LATEST version of the new branch
- or, if there is no new branch yet, will display the LATEST version of main, ready to create a new branch if a checkout occurs,
- or, if this is a brand new element (an "add to source control"), will create a version /main/0, and then immediately branch in order to create version 1 in the new branch:
(同样,按顺序应用了这3条规则,在第一个合适的位置停了下来,这就是为什么这样排序的原因)
(again, those 3 rules are applied in order, stopping at the first one that fits, which is why they are ordered that way)
这将转换为以下配置规范:
That would translate in the following config spec:
element * .../karthik_4/LATEST element * /main/LATEST -mkbranch karthik_4 element /main/0 -mkbranch karthik_4
注意:... / karthik_4 / LATEST语法是为了不将 karthik_4 分支绑定到main:即使 karthik_4 在主的任何其他分支的顶部(这就是 ... / ),它仍然会选择该新分支的最新版本(如果存在,如果不存在,则ClearCase尝试下一条规则)。
Note: the .../karthik_4/LATEST syntax is there in order to not tie karthik_4 branch to main: even if karthik_4 was created on top on any other branch that main (which is what .../ means), it would still select the LATEST version of that new branch (if it exists, if not ClearCase tries the next rule)
创建分支始终涉及3条规则,
Creating a branch always involve 3 rules, not just one.
现在,作为,这不会从特定版本(如 4)创建分支。 br>
它将仅在主分支上以其最新版本的文件版本创建分支:LATEST被称为移位标签:在每个新版本上它都会自动移位。
Now, as you saw earlier, this won't create a branch from a specific version (like '4').
It will only create a branch at whatever version a file is in its LATEST version on the main branch: LATEST is called a shifting label: it shifts automatically at each new version.
您可以为一个文件指定要从中创建分支的确切版本:
You could specify, for one file, the exact version you want to create a branch from:
element * .../karthik_4/LATEST element /path/to/myFile /main/4 -mkbranch karthik_4 element * /main/LATEST -mkbranch karthik_4 element /main/0 -mkbranch karthik_4
但这很难扩展,因为旁边的文件myFile 可能有不同的历史记录,其版本4可能早于 myFile @@ / main / 4 或之前创建的(或其他文件可能还不存在版本4!)。
But that won't scale easily, since the file next to myFile is likely to have a different history, and its version 4 might have been created long before or after myFile@@/main/4 (or version 4 might not exist yet for the other files!).
这篇关于如何建立分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!