Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git-svn ignore large binary files

Tags:

git

svn

git-svn

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.

like image 627
ajb Avatar asked Apr 09 '13 15:04

ajb


2 Answers

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)"
like image 55
rcomblen Avatar answered Oct 17 '22 14:10

rcomblen


git svn option --ignore-paths=

is useful to exclude unwanted binary files when converting svn repository to git

If you know the filename extensions of the binary files then you can write a regex expression to exclude them, FOR EXAMPLE,

.jar files:--ignore-paths=".*.jar$"

like image 2
JBTPublic Avatar answered Oct 17 '22 14:10

JBTPublic