Lets get the obvious stuff over with, create a directory in which to initialise the local git repository.
mkdir myproject
cd myproject
The initialisation itself is pretty simple, just remember to point Git at the correct url for your Subversion repository, and watch the communication protocols.
git svn init -s --prefix=svn/ svn+ssh://svn.repository.com/svn/myproject
The -s option tells the repository to expect the typical trunk, branches and tags structure of a Subversion project. You can specify the location of your trunk, branches and tags using the -T, -b, and -t respectively.
Using the --prefix option is handy, ensuring that the remote directories will be prefixed with svn/. This makes it clear which are Subversion and which git branches later.
All that remains is to checkout all of the information relating to your project from the Subversion repository.
git svn fetch
Depending on the size of the project, this could take a while, it’s downloading the entire project history from the remote repository.
I word of warning you about the strangeness that can ensue if the remote repository contains any tags. They will be imported as git branches, and you may find the local master branch pointing to something other that the remote trunk.
These git svn commands, and all the others, are pretty well documented. Now I’ve got a Git repository, in the next post I’ll to describe my normal workflow.
There are no comment for this post at the moment. Please feel free to let me know what you think.
XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.