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

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

问题描述

我不认为这不是标准的svn忽略问题.

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

我有一个我不需要的带有巨大目录的存储库.由于其他使用存储库 do 的人,我不能只是从树中将其删除.但是,我不想每次执行svn时都重新下载此目录.我可以理解,ignore会阻止我已将目录上载到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

,然后将来重新下载它.我想防止这种情况.

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兆.其中的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

我已经从结帐中删除了错误的目录.我无法从根目录执行向上升级",因为它会尝试重新签出不良目录.

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天全站免登陆