I’ve been experimenting a lot with this lately, and think I managed to come up with a setup that somewhat works. Yes, it’s a strict rebase-only regime, yes it’s complicated, but you do get to use Git for working locally (speed, history, stash, index, etc).
You can use branches behind the scenes when you collaborate with other Git users in your team I think, but haven’t personally experimented too much with this. As long as you linearize the log before dcommitting it should work.
Here’s the short version (repeats a lot what’s been already said):
- Clone the Subversion repo into a “fetching” repo on a central server
- Init a “bare” repo on the same server
- Push from the fecthing repo to the bare repo
- Have developers clone the bare repo and then
git svn init svnurlto configure the git-svn remote, andgit update-ref refs/remotes/git-svn refs/remotes/origin/masterso git-svn has a pointer to a revision
- Automatically (commit hook) have the “fetching” repo svn rebase, and push to the bare repo
- Developers pull from the bare repo with
git pull --rebase - Developers running
git svn dcommitfirst have to repeat theupdate-refabove in case of newer revisions coming from SVN.
There’s an illustration of the workflow on this page (I need more reputation points before I can inline the image). Update: Here we go:
