简体   繁体   English

在 SVN 更新期间忽略文件夹

[英]Ignore a folder during SVN updates

If I svn:ignore a really big folder will it improve performance during SVN updates?如果我 svn:ignore 一个非常大的文件夹,它会在 SVN 更新期间提高性能吗?

I have this really massive (>600MB) folder in my project.我的项目中有这个非常大(> 600MB)的文件夹。 The files in this folder should not be changing at all.此文件夹中的文件根本不应更改。 The problem is that every time I call "svn update" it takes forever.问题是每次我调用“svn update”都需要很长时间。 Is there a way to ignore this folder during updates to speed up the update process?有没有办法在更新过程中忽略此文件夹以加快更新过程?

The svn:ignore is only for files that are not already in the Subversion repository. svn:ignore仅用于尚未在 Subversion 存储库中的文件。 This folder already is.这个文件夹已经是。

You can use the svn update --set-depth exclude folderName to remove this folder from your working directory:您可以使用svn update --set-depth exclude folderName从您的工作目录中删除此文件夹:

$ svn update --set-depth exclude bigFolder  #Removes "bigFolder" from workdir
D bigFolder

$

Next time you do an update, bigFolder won't show up in your working directory.下次进行更新时, bigFolder将不会出现在您的工作目录中。 If you want it back, you'll have to reset the depth:如果你想要它回来,你必须重置深度:

$ svn update --set-depth infinity
U bigFolder
U bigFolder/File1
U bigFolder/File2
...

You could do an svn update and specifically mention every other directory, eg你可以做一个 svn update 并特别提到每个其他目录,例如

svn update dir1 dir2 dir3

Or, grep -v out what you don't want.或者, grep -v 找出你不想要的东西。

svn update `ls | grep -v big_dir`

Or, svn mv the big_dir up into another folder and change your build system to get the content from the other directory.或者, svn mv big_dir 到另一个文件夹并更改构建系统以从另一个目录获取内容。

Just do :做就是了 :

svn up `svn ls | grep -v big_dir`

Using "svn ls" You could update not only locally existing directories and files, but new files from repository.使用“svn ls”您不仅可以更新本地现有的目录和文件,还可以更新存储库中的新文件。 So, update is more complete, than just exclude.因此,更新更完整,而不仅仅是排除。 And You don't need to delete already existing files, like "--set-depth exclude" apparently does.而且您不需要删除已经存在的文件,就像“--set-depth exclude”显然那样。

Apart from what @Bill Brasky said, one suggestion is to move the huge folder into an external.除了@Bill Brasky 所说的,一个建议是将巨大的文件夹移到外部。 That way you can do svn up --ignore-externals这样你就可以做svn up --ignore-externals

If you don't want the huge folder in your working copy, you can have a look at sparse checkouts:如果您不想在工作副本中使用大文件夹,则可以查看稀疏结帐:

svn checkout repo . --depth empty
svn up other dirs
svn file structure:
trunk
|___ folder1
|___ folder2
|___ folder3
|___ other_folder

first when checkout , use immediates , only checkout first level folder and files :首先结帐时,使用立即数,仅结帐一级文件夹和文件:

  • svn co svn://svn-xxxx.com/svn/develop/trunk --depth immediates trunk, svn co svn://svn-xxxx.com/svn/develop/trunk --depth 即时中继,

then , set some folder for update later:然后,设置一些文件夹以供稍后更新:

  • cd trunk CD后备箱
  • svn up folder1 folder2 folder3 --set-depth infinity svn up folder1 folder2 folder3 --set-depth infinity

ok, now noly folder 123 will be able to update, and other first level folder still remain in the trunk folder ok,现在只有123文件夹可以更新了,其他一级文件夹还在trunk文件夹里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM