如何防止 SVN 更新存储库中已有的目录 [英] How to keep SVN from updating a directory already in repository

查看:18
本文介绍了如何防止 SVN 更新存储库中已有的目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为这不是一个标准的 svn ignore 问题.

This isn't, I don't think, a standard svn ignore question.

我有一个存储库,里面有一个我不想要的大目录.因为其他人使用存储库do,我不能只是从树中删除它.但是,我不想每次执行 svn up 时都重新下载此目录.我可以理解忽略会阻止我的目录上传到 svn,但是我如何告诉 svn 我不希望它重新下载存储库中已经存在的特定目录.

I have a repository with a huge directory in it that I don't want. Because others using the repository do, I can't just delete it from the tree. BUT, I don't want to redownload this directory every time I do a svn up. I can understand that ignore will prevent directories that I have from being uploaded to svn, but how I can I tell svn that I don't want it to redownload particular directories that are already in the repository.

我在做什么...

svn up
rm badDirectory

然后将来 svn up 重新下载它.我想阻止这种情况.

and then future svn up's redownload it. I want to prevent that.

谢谢!

好的.我希望 SVN 有一个我还没有注意到的内置选项.我希望避免破解" subversion 的不足之处,但下面的选项似乎是可以接受的替代方案.

edit: OK. I was hoping that SVN had a built in option that I just hadn't noticed yet. I was hoping to avoid having to "hack" around subversion's inadequacies, but the options below seem like acceptable alternatives.

再次编辑以解决一些评论:

edit again to address a couple of comments:

你有什么特别的理由无法检出该文件夹并保留它 ?没有磁盘空间(可能不是因为你可以检查一下)?安全原因?

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 megs.. 其中 290 位于这个坏"目录中.基本上,其他一些控制存储库的人(因此可以决定其中的内容)在那里放置了一个实际上不需要在那里的目录.我并不是说这是一个关于政策和使用 svn 的适当和正确"方法的问题.我只是想知道是否有技术解决方案.

I could check out the folder. The entire svn repository is about 291 megs.. 290 of it is in this "bad" directory. Basically, some other people who have control over the repository (and therefore get to decide what goes in there) put a directory in there that really didn't need to be in there. I didn't mean for this to be a question about policy and the "proper & right" ways to use svn. I was just wondering if there was a technical solution.

你能给出更好的描述吗?存储库的树结构?是否有与此级别相同的文件坏目录,或仅其他目录?——

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

推荐答案

所以我只是想出了我认为最快的问题答案.由于 SVN 无法自动忽略我不想更新的目录...

So I just came up with what I think is about the fastest answer to the question. Since SVN doesn't have a way to autoignore directories that I don't want updated...

这是我现有的目录结构:

Here's my existing dir structure:

根-> goodDir 1-> goodDir 2等

root -> goodDir 1 -> goodDir 2 etc

我已从结帐中删除了错误目录.我无法从根目录执行 'svn up',因为它会尝试重新检查坏目录.

I've deleted the bad directories from my checkout. I can't do an 'svn up' from the root directory, because it tries to recheck out the bad directories.

但是,以下命令效果很好:

But, the following command works nicely:

  ls | xargs svn up

简短、甜美、简单且易于记忆.

Short, sweet, simple, and easy to remember.

这篇关于如何防止 SVN 更新存储库中已有的目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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