Tag Archive for 'svn'

Importing a Subversion (svn) repository using git

I’ve been reading this excellent guide to learn a thing or two about git, specifically how to work locally with git and remotely with Subversion. After importing a repository with a command similar to this:

git svn init -t tags -b branches -T trunk http://example.com/repository

git svn fetch

I found that I had no branches and no tags. Well, the repository in question didn’t have any branches at the time, but it did have tags. I knew that git must be doing something clever with the tags, because the command takes the -t option seen above. I looked through the guide and elsewhere on the web, and came up with nothing.

I emailed the author, Sam Vilain, and he kindly responded and answered my question. It turns out that, because tags can be modified after they are created in Subversion, the git importer brings them in as remote branches. They can all be viewed with the git branch -a.

I promised Sam that I would blog this solution so that others could find it (and hopefully not bug him), and he responded:

even better would be a patch to:

git-clone http://utsl.gen.nz/talks/git-svn/.git

:-)

Sam.

How to convert a software installation into a Subversion checkout

Say you have some web software such as WordPress, MediaWiki, or Gallery installed, and you used a tarball and not Subversion. Now, you want to manage the installation using Subversion, but you don’t want to jump through hoops running diffs and moving files around.

Here’s how to do it (thanks to Asheesh for the recipe).

  1. Check out the software somewhere.
  2. (cd $PATH_TO_NON_SVN_DIR ; tar cf - . ) | (cd $PATH_TO_SVN_DIR ; tar xvf -)

This will “overlay” the non-svn-dir over the new checkout, leaving your existing installation untouched.




Close
Powered by ShareThis
All of mp3