Reputation: 22404
I'd like to work with a remote SVN repository using git-svn. I've been trying to download it with git svn clone -s REPO_URL
but because my network connection isn't great and the repo is quite big, it times out.
So, instead, I plan to checkout the entire repo using an SVN client, and then get git-svn working with it after the fact. But is that possible? git svn clone -s
takes takes care of all that stuff (i.e. setting remote URL, importing history, identifying remote branches, etc.), but since I'm downloading the repo another way, I don't know what commands I would need to run to set it up.
Upvotes: 2
Views: 869
Reputation: 22404
Ah, looks like an SVN client isn't needed. An interrupted git svn clone
can be resumed using git svn fetch
, as detailed here. :)
Or if you don't care about getting the entire history of the repository, you can speed up the download by doing git svn clone -s -rN:HEAD repo_url local_dir
instead, which will only clone the repository from a specific revision number (N
) to the latest commit (HEAD
). This significantly reduces the amount of data you have to download from the SVN server.
So that takes care of the problem of dealing with large repositories. But just to answer my question about how to get git-svn working with a repo that has been downloaded to disk, you can clone using the file://
protocol. Example: git svn clone file:///path/to/repo/
.
Upvotes: 3
Reputation: 15664
The magic that git-svn performs is to download the Subversion repository at every revision, meaning you get the full repository history on your local machine, as you would with a regular Git repository. It also pulls off a whole bunch of metadata about each commit, like the revision number and the commit log text.
If you were to just download the Subversion repository using wget
(or, more obviously, svn export
), you won't have all that information, and won't have a good way of obtaining it.
If you don't need the full history in your local repository, you can just clone the most recent revisions. Run git svn init
instead of git svn clone
(specify the same layout arguments, eg -s
). Then run git svn fetch -r HEAD
. This will only download the latest revision of the remote Subversion repository, and build your history on top of that.
Upvotes: 0