简体   繁体   中英

Having issues with git svn clone a non-standard repository

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
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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM