Start in Git, push to Subversion then work with git-svn
Git is frequently used as a Subversion client through git-svn. The nice thing about git-svn is that you can use the Git goodness (distributed workflow, offline support, sensible branching/merging, etc) on a project that is hosted in a Subversion repository. It just takes a while the first time as it needs to convert the Subversion repository history
However, less information can be found when you put things the other way around, i.e., when you start doing your work in Git then need to push it to a Subversion repository.
An easy workaround is of course to forget the history that you recorded in Git and simply push your content to Subversion. It is however more comfortable to push those changes to Subversion (step 1) and keep working in Git, occasionally pushing back to Subversion as you would normally do with git-svn (steps 2 and 3):

Here's how I did on recent project.
First of all you need your target Subversion URL to exist. If need be, create the repository and its structure. In my case I was going to push to a sandbox part of an existing Subversion repository, hence I first created the target directory (server, repository and project informations have been intentionally replaced):
svn mkdir https://server/svn/repo/sandbox/my-project
Next thing was to tell Git that it should track some Subversion history. It boils down to editing .git/configs from your Git repository and adding the following subsection:
[svn-remote "svn"]
url = https://server/svn/repo
fetch = sandbox/my-project:refs/remotes/svn
This creates a new remote branch called remotes/svn. You can rename it of course, and even add some branches and tags entries (see the git-svn documentation).
You can now import the (empty!) Subversion history into the remotes/svn branch:
git-svn fetch
This is not over yet. Indeed, remotes/svn and your current branch (master in my case) do not share any history: the one from Subversion is empty while your Git branch has one. What's more, your master branch is not linked with the Subversion metadata that allows git-svn dcommit to work. The solution is to rebase first:
git rebase remotes/svn
git svn dcommit
This can take some time depending on your Git history, as the rebase operation replays your commits on the empty Subversion history, while the dcommit pushes each commit to Subversion.
It's as simple as that, all you need is mainly some Git configuration editing.
Related posts:
- Howto: fork a Subversion project with Git
- Working on IzPack with Git and Subversion
- Making a stable release from a Subversion trunk… with Git
- Subversion + Git: when to choose one or the other?
- IzPack Git repositories on GitHub

September 19th, 2009 - 17:25
Nice & (not too much) short!
You should correct this line: “It boils down to editing .git/configs from your Git repository and adding the following subsection…”
September 20th, 2009 - 19:52
Thanks mate
February 17th, 2010 - 12:10
Hmmm.. I tried this way to get http://github.com/cakephp/cakephp1x/tree/1.3 into a new svn directory, rebasing did hundreds of patches but then it failed to apply patches and it became a mess. Guess I’ll do it the more ugly way.
thanks though!
March 6th, 2010 - 00:03
The method outlined here didn’t work for me. But this did:
http://eikke.com/importing-a-git-tree-into-a-subversion-repository/
June 3rd, 2010 - 11:11
Man, this does not work! The rebase operation fails on the first patch saying \error: : does not exist in index\