I started cloning an SVN repository using the git-svn's clone operation. After about 6 hours of importing (it's a big repo), my computer went and slept on me. Is there a way to resume the operation without redoing all of the initial work?
4 Answers
The git svn fetch
command to resume a git svn clone
is confirmed by several sources:
- Git svn and Gnome blog entry
(Incidentally, if during the initial clone step your connection dies or you need to stop it then to resume the clone you just have to run the above command to resume downloading the history).
There seems to be a memory leak in
git-svn
. The size of thegit-svn
process grew slowly and after about two weeks it was at 1.2 GB resident size, at which point the OS refused to let it fork.
Thing is, this was a blessing in disguise.
I was able to resume the interrupted clone with a simple "git svn fetch
", and it ran much faster with the now radically smaller heap.
This, worked so well, in fact, that I got into the habit of interrupting and restarting the process every evening and every morning. A few days later it was done.
You start your adventures with
git-svn
by cloning an existing Subversion repository:
git svn clone url://path/to/repo -s
The
-s
flag assumes that your repository uses the "trunk, branches, tags" convention. If not, you have to specify manually which directories represent branches and tags, if you want Git to know about them.This will take a long time, as it will fetch every single revision from SVN and commit locally. If for any reason it stops, you can resume with
git svn fetch
.

- 1,262,500
- 529
- 4,410
- 5,250
-
1I think some of the command line options provided to `git svn clone` also need to be provided (as applicable) to `git svn fetch`. E.g., i had set `-r HEAD` for `git svn clone` to get only the HEAD SVN revision. To resume i ran `git svn fetch`, which started importing all revisions. – amolbk May 14 '15 at 05:38
-
This started everything over from the first revision.... I have 10,000 commits! Any thoughts on how to *resume* from where it left off? – Nathan J.B. Aug 11 '15 at 18:54
-
@NathanJ.Brauer not on the top of my head. You could ask a new question (with the OS, git version and svn version used, and a link back to this answer for context) – VonC Aug 11 '15 at 19:02
-
1I accidentally killed my network connection during `git svn clone`, interrupting the process. Running `git svn clone` again appeared to resume the clone-in-progress. Anybody else done this? – keeehlan Nov 07 '17 at 21:37
-
1@Kehlan Apparently so, if you consider [zan-xhipe's answer below](https://stackoverflow.com/a/25788860/6309) – VonC Nov 07 '17 at 21:40
-
The first link is dead, but can still be resurrected at archive.org : https://web.archive.org/web/20101203210755/http://gsocblog.jsharpe.net/archives/4 – JohnP May 22 '19 at 19:49
-
@JohnP Thank you. I have restored the link accordingly. – VonC May 23 '19 at 04:31
I found a blog post that provided what (I hope) is a correct answer.
Apparently, running git svn fetch
effectively completes the clone operation. Here's hoping!

- 37,021
- 23
- 116
- 145
-
7you'll have to use `git svn rebase` after the fetch to complete the operation and have the master branch reflecting the trunk – Romuald Brunet Apr 20 '10 at 16:51
-
From at least git 2.1.0 you can resume by just reissuing git svn clone
However this will duplicate some entries in your .git/config remove those and everything will be fine

- 101
- 2
- 4
-
`From at least git 2.1.0...` Any idea if this feature existed at git 1.9.1? – CivFan Jun 10 '15 at 18:46
-
-
`git svn fetch` caused a checksum mismatch for me - and was impossible to reset because there was apparently no HEAD :/ - but this works fine, just had to remove the `svn-remote.fetch` from `.git/config` – OLL Nov 02 '15 at 11:03
As VonC, CaptainAwesomePants and Archi all said git svn fetch
does the trick. I was doing a git svn clone url... --authors-file=path/to/file
and the clone failed because one of the authors wasn't in the authors file. I added the author to the file and ran git svn fetch
and it continued from where it left off and looking at the git log later, it seems that it used the newly added author to replace the commit author's name so all was sweet.

- 4,031
- 4
- 41
- 36