Git Svn clone certain revision, and continue cloning other revisions in the future
git svn clone -r100000:HEAD https://svn.myserver.com/project/ .
It completed succesfully, but I only have the latest few commits. Is there anyway to continue cloning the earlier commits?
P.S: cloning the entire repo without -r always result in RA layer request failed: REPORT request failed on ‘svn/project/!svn/vcc/default’: … could not read chunk size: Secure connection truncated … Sometimes, it is after a few days… so I decided to abandon it and clone only partially
EDIT: Add the error message
RA layer request failed: REPORT request failed on ‘/svn/project/!svn/vcc/default’: REPORT of ‘/svn/project/!svn/vcc/default’: Could not read chunk size: Secure connection truncated (https://svn.myserver.com) at /usr/lib/perl5/site_perl/Git/SVN/Ra.pm line 282
2 Solutions collect form web for “Git Svn clone certain revision, and continue cloning other revisions in the future”
If you want the entire history, why not start at your svn repo’s rev 1? Granted it will take a while, but you could do it in parts. For example:
git svn clone -r1:10000 https://svn.myserver.com/project/ .
Once that completes cd into project and run:
git svn fetch svn -r10000:20000
you can even overlap:
git svn fetch svn -r9997:20000
and it’ll skip past the pieces it already got. You may just not want to create gaps.
And I recognize that you’ve tried to pull it all before without any -r spec and got errors, but maybe doing it in sections will get past that. If you do get an error, try running the same command again. In using
git svn clone in the past I’ve had many cases of it losing connection or having random errors, but cd-ing into the project and
git svn fetch or
rebase-ing (sometimes repeatedly) seems to keep picking up where it left off before.
with git you cannot add history “in front of” what you already have. every git commit references ALL COMMITS EVER that it is a successor to (via inclusion of a hash of these commits). it is possible to rewrite history (and add new commits in front), but that gives you totally new commits (changed hashes) and is not what you want to do in an actively used repo.
you should either grab as much history as you can and claim it an “initial import”, or try to fix the import problem. when you talk about days, it sounds as if you could benefit from moving closer to the svn repo, i.e. run the commands on the svn server itself to spare network overhead/latency.
also it might help to give more information about the actual errors you encounter.