Import Git Repository into Subversion

05 Mar 2009

This is probably supremely easy to do but all my searches on google yield results on how to import a subversion into a git repository and I need the other way around so I came up with the following.

Start by creating the folder in subversion into which you wish to import. In the directory with the git repository do this:

~/Sites/slices(master) $ cd ..
~/Sites $ git svn clone https://svn/slices/trunk clone_slices
~/Sites $ cd clone_slices
~/Sites/clone_slices $ git pull ../slices
~/Sites/clone_slices $ git svn dcommit
# rename the folder if you want:
~/Sites/clone_slices $ cd ..
~/Sites/clone_slices $ rm -rf slices
~/Sites/clone_slices $ mv clone_slices slices