git svn: Clone latest revision only


You want to use git-svn to clone a SVN repository, but you don’t want to clone the entire history (which can be quite slow) but only the latest revision.


See this post for an explanation of how to get the latest SVN revision of a remote repository. You can use this command in a shell to generate the argument for the -r option of git-svn clone:

git svn clone -r `svn info <Repository URL> | grep Revision | cut -d' ' -f2` <Repository URL> <Target path>

You can also use this bash script:

# Usage: ./ <SVN repo URL> [<target directory>]
git svn clone -r `svn info $1 | grep Revision | cut -d' ' -f2` $1 $2