如何恢复 svn 存储库中意外删除的文件夹
我知道如何使用以下说明恢复到文件夹的特定版本:
但是,我删除了整个文件夹,并希望恢复该文件夹而不恢复存储库的其余部分。
我尝试重新创建该文件夹,然后将更改合并回来,但 svn 知道我的技巧并意识到它是一个新文件夹。
我该怎么做?
I know how to revert to a specific revision of a folder using these instructions:
However, I deleted the entire folder and want to get that folder back without reverting the rest of the repository.
I tried recreating the folder and then merging the changes back, but svn knows my trick and realizes it is a new folder.
How should I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
最简单的方法可能是svn复制你想要的树,从它最后存在的版本:
请参阅Subversion 书籍 了解详细信息。
The easiest way is probably to svn copy the tree you want, from the revision where it last existed:
See the Subversion Book for details.
您可以签出新的工作副本,然后导出您感兴趣的文件夹。导出文件夹后,其中将不再包含 Subversion 元数据。然后,您可以将该文件夹放入从中删除的工作副本中。
祝你好运。
You could check out a new working copy, and then do an export of the folder you're interested in. Once you've exported the folder, it won't have subversion metadata in it. Then you can put the folder into the working copy that it was deleted from.
Best of luck.
如果您在重新创建文件夹后提交了更改,则可能会遇到与我相同的问题:
我丢失了文件的历史记录。然后我再次
svn删除
该文件夹,并且在执行操作时收到此错误:
在这种情况下,您可以使用辅助文件夹(~/tmp/)执行操作
它将创建~/tmp/目录/文件夹及其包含的所有文件。
假设您删除目录的位置是 /location/of/my/trunk/path/to/ ,
然后
从该路径发出一个到它应该在树中的路径的命令。
If you have committed the changes after recreating the folder it is possible that you have the same problem I had:
I lost my history for the files. Then I
svn deleted
the folder again, and when doing aI received this error:
In that case you can use an auxiliary folder (~/tmp/) to do an
It will create the ~/tmp/directory/ folder with all the files it contained.
suppose that the place where you deleted directory was /location/of/my/trunk/path/to/
and then issue an
from that path to the path it should be in your tree.