git-svn忽略大的二进制文件 [英] git-svn ignore large binary files
问题描述
我正在与一个大的svn仓库(30,000多个版本)合作。
我使用的git-svn的成功有限。
我的主要问题是svn版本库包含大型二进制文件(〜30MB)的频繁更新。我不关心这些文件的历史,但我关心这些文件的当前版本。
git svn rebase运行非常缓慢,因为自从我上次svn rebase(这很常见)以来,对大二进制文件进行了多次更新。我的git数据库也增长得非常快。我希望解决这两个关键问题。理想情况下,我想要做的就是完全忽略来自svn的这些大文件,然后运行一个只读取最新版本,然后我会阻止我的.gitignore。尽管我对其他选项非常开放。 使用可以忽略一些文件。
git svn
的忽略路径选项:
--ignore-paths =< regex>
这允许您指定一个Perl正则表达式,
会导致从SVN签出时跳过所有匹配的路径。
--ignore-paths选项应该匹配每个提取
(包括由克隆,dcommit,rebase,
等自动提取)给定的存储库。
config key:svn-remote。< name> .ignore-paths
如果设置了ignore-paths配置项并且命令行
选项是也给出了,两个正则表达式都将被使用。
示例:
跳过每个抓取的doc *目录
--ignore-paths =^ doc
跳过第一级目录的branches和tags
--ignore-paths =^ [^ /] + /(?: branches | tags)
I'm working with a large svn repository (30,000+ revisions). I am using git-svn with limited success.
My major problem is that the svn repository contains frequent updates to large binary files (~30MB). I do not care about the history of these files but I do care about the current versions of these files.
git svn rebase runs very slowly if there have been multiple updates to the large binary files since my last svn rebase (which is common). My git database also grows very quickly. I'm looking to resolve these two key issues.
Ideally, what I would like to do is completely ignore these large files from svn and then run a script that fetches only the latest version which I would then block with my .gitignore. I'm very open to other options though.
you can ignore some files using the --ignore-paths
option of git svn
:
--ignore-paths=<regex>
This allows one to specify a Perl regular expression that will
cause skipping of all matching paths from checkout from SVN.
The --ignore-paths option should match for every fetch
(including automatic fetches due to clone, dcommit, rebase,
etc) on a given repository.
config key: svn-remote.<name>.ignore-paths
If the ignore-paths config key is set and the command line
option is also given, both regular expressions will be used.
Examples:
Skip "doc*" directory for every fetch
--ignore-paths="^doc"
Skip "branches" and "tags" of first level directories
--ignore-paths="^[^/]+/(?:branches|tags)"
这篇关于git-svn忽略大的二进制文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!