Checking out a subversion repository with git


Git Logo by Jason Long /CC BY 3.0

Everyone who has worked with git for some time and has to go back to subversion will experience the feeling that subversion is doing so many things wrong and making things unnecessary
complicated. Luckily git comes with a build in svn bridge which enables us to work local with git while on the server side nobody will see a difference to any other svn client.

To start working with git we need to checkout the svn repository. Therefore a empty folder has to be created locally which is not under git control currently. Therefore type on your shell:

mkdir gitTest

After that change to that folder and perform the checkout/clone:

cd gitTest
git svn clone -T trunk -t tags

The IP has to be replaced by the IP of the subversion repository. The option -T trunk -t tags tell git that we want to checkout the trunk only (which is a folder on the svn repository named “trunk”) with the svn tags. For a full clone with all branches etc the option -stdlayout is needed:

git svn clone -stdlayout

After this the git repository is ready to work with. How my workflow with git svn looks like will be topic of the next post.

This entry was posted in coding, git, howto and tagged , , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">