Export git repository to svn

Viewed 5588

cloning an svn repository into git is easy with git-svn. However, I need to do it the other way round. I have a git repository lying around and want to import it into an empty (except from trunk, branches and tags folders) keeping all the commit information.

I cerate a git-svn-clone of the svn repo, pulled the git master and dcommitted. However the only commit I have in svn then is the one saying "merged from git"

I also tried the other way: Cloned the git repositoy and called git svn init but git keeps saying "Unable to determine upstream SVN information from HEAD history."

Is it somehow possible to create an svn repository from git?

Cheers, Michael

2 Answers

Here is my recipe for publishing a git repo via svn:

svn mkdir --parents http://host/path/to/repo/{trunk,tags,branches} \
    -m "Standard layout for $project"
git svn init -s http://host/path/to/repo/
git svn fetch
git rebase trunk master
git svn dcommit

Subversion won't preserve commit times or authorship. God help you if you used branches.

Related