我认为这不是标准的 svn 忽略问题。
我有一个存储库,里面有一个我不想要的巨大目录。因为使用存储库的其他人这样做,我不能只是从树中删除它。但是,我不想每次执行 svn up 时都重新下载此目录。我可以理解忽略会阻止我将目录上传到 svn,但是我如何告诉 svn 我不希望它重新下载存储库中已经存在的特定目录。
我所做的...
svn up
rm badDirectory
然后 future 的 svn up 重新下载它。我想阻止这种情况。
谢谢!
编辑:好的。我希望 SVN 有一个我还没有注意到的内置选项。我希望避免不得不“破解” subversion 的不足之处,但下面的选项似乎是可以接受的替代方案。
再次编辑以解决一些评论:
Is there particular reason why you cannot check-out that folder and keep it ? no disk space (probably not since you can check-out it) ? security reason ?
我可以查看文件夹。整个 svn 存储库大约有 291 兆字节。其中 290 兆字节在这个“坏”目录中。基本上,其他一些控制存储库的人(因此可以决定其中的内容)将一个目录放在那里,而实际上不需要在那里。我并不是说这是一个关于政策和使用 svn 的“正确和正确”方式的问题。我只是想知道是否有技术解决方案。
Can you give a better description of the tree structure of the repository? Are there files at the same level as the bad directory, or only other directories? –
基本结构:
repository root
- good dir 1
- plenty of subdirs in all of these directories
- good dir 2
- good dir X
- bad dir 1
- bad dir 2
- bad dir X
- good file 1
- good file 2
- good file X
最佳答案
我选择了类似于 Stefan 提到的稀疏结账路线。不同之处在于我排除了整个目录。
这是我为排除整个目录及其所有子目录所做的工作。注意:不需要的目录已经在我的磁盘上,所以我先删除了它。
$ rm -rf unwanted-directory
<- 不需要的目录不是从存储库中获取的
$ svn checkout url/to/repo/unwanted-directory unwanted-directory --depth empty
$ cd root/of/my/tree
$ svn update
作为引用,我们的树中有一个“prototype”目录,里面有一堆实验代码。因为我不在这个领域工作,所以我对在我的多个开发树中使用 1G 源没有兴趣。
关于svn - 如何防止 SVN 更新存储库中已有的目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/508135/