svn del 之后的 svn cat [英] svn cat after svn del
问题描述
我无意中用 svn del --targets del.txt
svn 删除了一个文件.现在,我想用 svn cat myPreciousFile.txt@4130 > 恢复该文件.myPreciousFile.txt
,但 svn 给了我一个警告,myPreciousFile.txt 不受版本控制.svn cat -r 4130 myPreciousFile.txt >myPreciousFile.txt
也不起作用.
I have inadvertently svn-deleted a file with svn del --targets del.txt
. Now, I'd like to recover that file with svn cat myPreciousFile.txt@4130 > myPreciousFile.txt
, but svn gives me a warning that myPreciousFile.txt is not under version control. A svn cat -r 4130 myPreciousFile.txt > myPreciousFile.txt
didn't work, either.
谁能告诉我如何再次恢复这个文件?
Can someone please tell me how I'd go about recovering this file again?
编辑
好的,我已经用 svn merge
试过了,但还是不行.这是我所做的(更改文件名以保护有罪者...):
Ok, I have tried it with svn merge
, but it still doesn't work. Here's what I did (file names altered to protect the guilty...):
f:\path\to\dev\dir> svn diff -r 4250:4251 --summarize
D file_one.tyb
D file_two.tyb
D myPreciousFile.txt
我将此输出解释为myPreciousFile 已在修订版 4251 中删除".所以,我用 svn merge
试了一下:
I interpret this output as "myPreciousFile was deleted in revision 4251".
So, I tried it with svn merge
:
f:\path\to\dev\dir> svn merge-c -4251 myPreciousFile.txt
并且 svn 仍然警告我 myPreciousFile.txt 不受版本控制.(顺便说一句,与 svn merge-c -4250 myPreciousFile.txt
相同的错误消息.
And svn still warns me about myPreciousFile.txt not being under version control. (Same error message btw with svn merge-c -4250 myPreciousFile.txt
.
推荐答案
不得使用 cat
恢复文件.
You must not restore file with cat
.
正确的做法是copy
svn copy http://server/full/path/to/myPreciousFile.txt@4130 .
在提交当前目录之后.使用此解决方案,您将保留该文件更改的完整历史记录.
after that commit current directory. with this solution you will keep the complete history of changings of that file.
这篇关于svn del 之后的 svn cat的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!