0

Background

I am working with a huge SVN repository (full clone is ~20Gb), it has the following top-level strucuture:

stuff
stuff/branches
stuff/tags
stuff/trunk
stuff/archive
stuff/build
stuff/machines
stuff/releases

First point: I have no clue what stuff is contained in the [archive, machines, build & releases] directories and to be honest - I don't really care - I just know I don't need them stored locally to do development work.

Second point: Other than the silly directories for storing artifacts, on the surface this seems like a standard SVN layout. However, when you dig deeper, it's bizzare as the trunk directory contains multiple projects, for example:

stuff/trunk/mars
stuff/trunk/earth
stuff/trunk/venus
stuff/trunk/saturn
stuff/trunk/pluto
...

And the branches folder has been organised as described:

stuff/branches/<project>-<name of project branch>

Where each branch has been branched from one of the projects in:

stuff/trunk/<project>

What am I trying to achieve?

I only want to clone stuff from the pluto project (~20Mb). For example when doing this in SVN, I would issue the following command:

svn checkout https://svn.example.com/svn/stuff/trunk/pluto
...
Checked out revision 3505

My issue is that I am unable to replicate this using git-svn. I've tried numerous times with different options to "git svn clone" and every time I end up cloning the entire repo (~20Gb) or nothing. Surely it shouldn't be this difficult so I must be doing something wrong.

If I'm able to git-svn clone just the pluto project, when I create a new branch with git-svn I also want it to create me an SVN branch, for example, I want the following commands to be equivalent:

svn copy https://svn.example.com/svn/stuff/trunk/pluto \
    https://svn.example.com/svn/stuff/branches/pluto-1234 \
    -m "Making branch pluto-1234 from /stuff/trunk/pluto"

git svn branch -m \
    "Making branch pluto-1234 from /stuff/trunk/pluto" \
    pluto-1234

So that a new SVN branch is created at the following location:

stuff/branches/pluto-1234

1 Answer 1

1
git svn clone --trunk stuff/trunk/pluto --branches stuff/branches --include-paths='stuff/branches/pluto-.*'

pluto-.* is a regular expression to select desired branches. See https://git-scm.com/docs/git-svn#Documentation/git-svn.txt---include-pathsltregexgt

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks.... Your hint helped me work out how to solve the problem! The command I issued was: git svn init svn.example.com/svn/stuff --trunk=trunk/pluto --branches=branches/* --include-paths=branches/pluto-* --prefix=git-svn/ pluto

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.