撤消ClearCase中的删除文件 [英] Undo remove file in ClearCase

查看:127
本文介绍了撤消ClearCase中的删除文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有一个文件夹和两个文件的ClearCase视图。我检出该文件夹,删除文件,然后将其检回。我只剩下一个文件夹和一个文件。有办法找回我的文件吗?我使用的是标准的Windows工具套件,其中包括cleartool。

解决方案

是的,可以取回文件。这是ClearCase的一项重要功能(有时是救生程序)。



假设您的目录为 / vobs / somevob / somedir 。其中有两个文件的目录版本为 / main / 3 ;因此,一个文件的版本为 / main / 4 。删除的文件为 / vobs / somevob / somedir / crucial 。假设 ct cleartool 的别名,则可以执行以下操作:

  cd / vobs / somevob / somedir 
ct co -c'恢复文件至关重要'。
ct ln。@@ / main / 3 / crucial。
ct ci -nc。

第一行意味着我不必在其他三个命令中键入目录的路径;否则,它是可选的。第二行检出目录,以便可以对其进行编辑。最后一行检查修改后的目录。第三行是魔术发生的地方...



ct ln。@@ / main / 3 / crucial。行标识在目录 / main / 3 中看到的文件 crucial >。并将其链接到当前目录(该目录的签出版本)。您看到的文件版本将是cspec选择的文件版本,但是视图中的文件正确(假设您确实选择了 / vobs / somevob / somedir @@ / main / 5 与您的cspec)。



(请注意,您不仅可以返回一个版本的链接,还可以在10年后恢复文件,并且如有需要,可提供20个版本。尽管您可以一次将文件链接到两个目录,但这是极不推荐的;请使用符号链接。您可以将已删除的文件从其上一个已知位置恢复到另一个目录中。)

I have a ClearCase view with a folder, and two files. I check out the folder, remove a file and check the folder back in. I am left with one folder and one file. Is there a way to get my file back? I'm using the standard Windows suite of tools, which include cleartool.

解决方案

Yes, it is possible to get the file back. This is an important feature of ClearCase (and a life-saver on occasion).

Let's say that your directory is /vobs/somevob/somedir. The version of the directory with two files in it was /main/3; the version with one file was therefore /main/4. The dropped file is /vobs/somevob/somedir/crucial. Assuming ct is an alias for cleartool, you then do:

cd /vobs/somevob/somedir
ct co -c 'Recover file crucial' .
ct ln .@@/main/3/crucial .
ct ci -nc .

The first line means I don't have to type the path to the directory in the other three commands; otherwise, it is optional. The second line checks out the directory so it can be edited. The last line checks in the modified directory. The third line is where the magic occurs...

The ct ln .@@/main/3/crucial . line identifies the file crucial that was seen in version /main/3 of the directory . and links it to the current directory (the checked out version of the directory). The file version you see will be the one chosen by your cspec, but the correct file is in the view (assuming you do in fact pick up /vobs/somevob/somedir@@/main/5 with your cspec).

(Note that you aren't limited to doing the link one version back; you can reinstate a file after 10 years and 20 versions if you need to. Although you can link a file to two directories at once, that is highly unrecommended; use a symlink instead. You could recover a deleted file into a different directory from its last known location.)

这篇关于撤消ClearCase中的删除文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆