我正在使用大型 svn 存储库(30,000 多个修订版)。 我使用的 git-svn 取得了有限的成功。
我的主要问题是 svn 存储库包含对大型二进制文件 (~30MB) 的频繁更新。我不关心这些文件的历史,但我关心这些文件的当前版本。
如果自从我上次 svn rebase 以来对大型二进制文件进行了多次更新(这很常见),git svn rebase 运行速度会非常慢。我的 git 数据库也增长得非常快。我希望解决这两个关键问题。
理想情况下,我想做的是完全忽略来自 svn 的这些大文件,然后运行一个脚本,该脚本只获取最新版本,然后我将用我的 .gitignore 阻止它。不过,我对其他选择持开放态度。
最佳答案
你可以使用 git svn
的 --ignore-paths
选项忽略一些文件:
--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 忽略大型二进制文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15906391/