I’m tracking a project that has recently moved from svn to git. I’ve got the most recent svn code and want to start using the code from git. Is there a way to do this that doesn’t involve re-downloading quite a large codebase over a slow connection? Essentially, I want to be able to say “start from here (old svn code) and just get the changes from git”.
Share
SVN & Git may seem similar because they’re both SCM tools, but under the hood, they’re implemented very different, i.e. Git is way better.
Just start from fresh and git clone it. Even for large projects like the Linux Kernel, Git is very fast at cloning.
You could also use the
--depthoption to speed things up:Source: http://git-scm.com/docs/git-clone
Here’s an example that checks out the most recent version of the repository:
Source: http://mortalpowers.com/news/speed-up-git-clone-with-shallow-clones
You can later use the
--depthoption withgit pull:Source: http://kernel.org/pub/software/scm/git/docs/git-pull.html
Perhaps, if you put a large enough number (or maybe -1?) for depth so as to pull in the entire history of the repository, then you’ll have all the functionality of a normal repository, e.g., the ability to clone or fetch from it, or push from or into it.
If not, you can just clone it normally in a separate place (perhaps when you have a faster connection) and use
git format-patchandgit applyto move your commits from the shallow repository into the new one.Matt