git-svn 忽略大型二进制文件

标签 git svn git-svn

我正在使用大型 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/

相关文章:

Git-tfs:增量迁移

ios - Xcode:禁用后启用Create Git Repository

git - yarn install 在 git post-receive hook 中克隆 github 包时失败

svn - 开发团队使用 GIT/Mercurial 与 SVN 交叉

linux - 颠覆: Skipping folders when not in working directory

svn - Git 到 svn : Adding commit date to log messages

c - 如何使用 libgit2 创建空提交?

git svn 获取 'Error running context: Software caused connection abort at...'

git - 从 svn 存储库克隆 git 存储库,导致无文件、无远程分支的 git 存储库

git - 在 git-svn 项目中使用 git 子模块