how to remove a version in clearcase

时光毁灭记忆、已成空白 提交于 2019-12-05 08:13:28
VonC

First, as mentioned in How do I roll back a file checked in to Clearcase?, the one command to never ever do is rmver.
Even if in your case it could be appropriate, this is simply too dangerous, for it removes the version and all its associated metadata (hyperlinks, labels and so on).

Then, you mention:

rather than checked out /vobs/myvob/src I checked out /vobs/myvob/scr/...

... well /vobs/myvob/src is quite similar to /vobs/myvob/src here. I do not see any differences between the "two" directories.

If you want to add a file to a directory through the CLI cleartool, you will need to:

  • checkout /vobs/myvob/src (parent directory)
  • mkelem the file to add
  • checkin the parent directory

Finally, the "version 0" you see is only a "declarative" version to act as a starting point for branches.
That is why the other answers suggest you to rmbranch (remove the branch) for that element. It only serves the purpose of cleaning the lsvtree (version tree).

"cleartool rmbranch -force $element"

as mentioned in the ten best scripts.

Even if you remove version 1 of a file on your branch, your branch will remain (with version 0). If you really want to do a clean-up you can remove the branch (ct rmbranch your_branch) for the file -- it won't remove the version from mainline.

If you want to completely remove a version of an object (file or directory) from Clearcase control, I suggest you to use the following command:

cleartool rmver –xbranch –xlabel –xattr –xhlink test.txt@@\main\3

Command options are described on this snip2code post.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!