伪造 SVN 结帐的深度
由于某种原因,我的 SVN 存储库的本地副本停止将父目录识别为工作副本。我通常会通过再次检出另一个文件夹并用我更改的文件覆盖新的工作副本来解决此问题。然后我将从新文件夹中进行提交。
我想避免在这种情况下这样做,因为存储库包含数千张大图像,并且签出需要很长时间。所以我想做的是非完全递归地签出到一个新目录,将现有文件复制到新目录,然后签入整个文件。
问题是 SVN 知道我只签出了几个文件。有没有办法可以伪造它并使 SVN 认为我刚刚进行了完整的结帐? (例如,我可以只获取 .svn 文件夹以进行完整的结帐,而无需实际检查所有内容)
For some reason my local copy of an SVN repo stopped recognising the parent directory as a working copy. I would normally fix this by checking out again into another folder and overwriting the new working copy with my changed files. I would then do a commit from the new folder.
I want to avoid doing that on this occasion because the repo contains thousands of large images and checking out takes a long time. So what I want to do is check out non-fully recursively into a new directory, copy my existing files into the new directory, and then check the whole thing in.
The trouble is that SVN knows I only checked out a few files. Is there a way I can fake it and make SVN think I just did a full checkout? (e.g. a way I can get hold of just the .svn folder for a complete checkout without actually checking everything out)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
在新位置对存储库进行稀疏检出应该可以满足您的要求(http://svnbook.red-bean.com/en/1.5/svn.advanced.sparsedirs.html)。如果我理解正确的话,您将需要对最顶层目录进行空签出,然后仅对您想要的工件执行“svn up”,并根据需要设置深度。
例如,假设我有一个名为“foo”的顶级文件夹,它包含两个文件夹“bar”和“zoog”。
文件夹“zoog”有大量我目前不关心的文件,但我希望能够使用“bar”。我会执行以下操作:
现在“svn up”显示所有内容都是最新的,我可以在“foo”和“bar”中进行更改并提交它们,就像我也签出了“zoog”一样,而无需所有开销。
(svn update 中 --set-depth 的参数为 except、empty、files、immediates 和 infinity)
A sparse checkout of your repository in a new location should do what you want (http://svnbook.red-bean.com/en/1.5/svn.advanced.sparsedirs.html). If I understand you correctly, you will want to do an empty checkout of the topmost directory and then do an 'svn up' on just the artifacts you want, setting the depth as you go.
For example, let's say I have a top level folder called 'foo' and it contains two folders, 'bar' and 'zoog'.
The folder 'zoog' has a large number of files that I don't care about at the moment but I want to be able to work with 'bar'. I would do the following:
Now 'svn up' shows everything is up to date and I can make changes in 'foo' and 'bar' and commit them as if I had also checked out 'zoog' without all of the overhead.
(The arguments to --set-depth in svn update are exclude, empty, files, immediates, and infinity)
您很可能损坏或删除了每次结账时隐藏的
.svn
文件夹。使用命令行在其他地方执行 svn co svn://your/svn/repository --深度立即执行 并从那里恢复 .svn 文件夹。然后,您将需要执行大量
svn update.
和svn cleanup
序列,以将子文件夹与父文件夹重新关联。You most likely damaged or deleted the hidden
.svn
folder inside every checkout.Use the command line to do
svn co svn://your/svn/repository --depth immediates
elsewhere and restore the.svn
folder from there. Then you will need to go through a lot ofsvn update .
andsvn cleanup
sequences to re- associate the subfolders with the parent folder.首先备份您的完整工作副本。然后将您的工作副本更新到最新版本。你的最后一个版本有根文件夹。 SVN 将尝试再次写入该文件夹。然后就会显示树冲突。然后运行清理并再次提交。
First backup your full working copy. Then update to last revision your working copy. your last revision has root folder. SVN will try to write that folder again. Then a tree conflict will show. Then run cleanup and commit it again.
如果仅工作副本的根目录已损坏,并且大文件(或许多文件)位于工作副本根目录下的目录中,则以下过程应该可以正常工作,而无需再次从存储库下载文件:
之后应该可以正常操作 - 如果没有其他损害。
注意:
If only the root of the working copy has been damaged and the large (or many files) are in directories below the working copy root the following procedure should work without downloading the files from the repo again:
After that normal operation should be possible - if there are no other damages.
Notes: