views:

218

answers:

2

I think my question is somewhat similar to CaptainPicard's but dissimilar enough that I feel compelled to ask so here goes.

I have an old SVN repository with around 7500 revisions and part of those 7500 revisions are some pretty large .fla files. And these .fla files exist in a number of the branches which have been created. As a result of this my .git directory after import is pretty large, something like 3.5 GB if I get the whole trunk, all the branches and all the tags. In an effort to pair this down some I did another svn clone of just the directory in trunk I wanted to work with but including all branches obviously pulls down all the history and objects for those.

So my question is this, is there some way to tell git to only fetch certain branches. For example only fetch branches starting with some identifier (e.g. mybranch)?

Update for clarity: I know I can point git svn init/clone at a single specific branch. What I want to be able to do is point it at a set of branches. For example, instead of matching branches/* only branches matching mybranchset*

A: 

You can specify git svn init with a svn url of your choosing, including pointing at a particular branch or even part of a branch.

You should also consider doing a "git repack -f -a -d --window=250" to see if git can find some way to make your 3.5 GB repository smaller.

Emil
+1  A: 

In git svn commands, you can only use the asterisk wildcard to specify all members of a directory (directoryname/*) and not filename variations (fileprefix*). That may change in the future if git svn is revised to make use of SVN's new merge tracking.

Because Git only stores a pointer to a commit for each branch (rather than a duplicate directory of the relevant files), your Git repo will be substantially smaller once you have repacked it, as the anonymous answer says. Unfortuately, Git can't store changesets for your Flash files like it does for text file commits, so they will be duplicated when they change.

I suggest you use

$ git gc --aggressive

to repack your repo. It prunes duplicates and handles more optimizations than git repack.

Paul