git svn - clone repo with all externals

I want to use git to clone a svn repository, but unfortunately, where svn checkout gets the repo with all externals, git svn clone only gets the repository without externals. How can I get the externals from the svn repository via git svn? I don't want to do any fancy stuff, just get the the complet repo with externals.

Answers


git-svn doesn't support externals, but you may try SmartGit instead of git-svn. It supports svn:externals, converting them into .gitsvnextmodules file and displaying as modules. The only restriction: you should clone the repository with SmartGit instead of opening already existing git-svn repository.


I have been use git as a front end to access a SVN repository. The structure in SVN is generally pretty simple such that there is top level directory which has the externals in it and no externals in sub-directories. Also the externals don't really change much once they are added in. So assuming something like:

git svn clone X
cd X

I have had success getting all the externals with the following command:

git svn show-externals | \
 perl -ne 'if (/^\/(.*) (.*)/) { print "git svn clone $1 $2\n"; }' | \
 bash

I guess a more complicated structure for externals would require a more complicated perl script. Also, if your externals change you will need to do something similar again.


I post solution here that works in my case

git svn show-externals | \
  awk '/^\// { print "git svn clone "$3" ."$1" "$2":HEAD"  }' | \
  bash

Need Your Help

translateX to left of viewport

javascript css css-animations velocity.js

Is there a way to translateX to the left side of the viewport? I need to use CSS animation using translateX rather than left.

How to disable logo in Windows 8 metro app live tile?

windows-8 microsoft-metro live-tile

I am trying to disable the logo in my metro app live tile so that the last line of text in my tile notification will show. The Windows 8 documentation