sharp bites

standing on the shoulders of giants

git started #1. Using git with a svn server

So, you already know that svn sucks and you want to switch to git because you know it’s awesome, but you are stuck in a team environment of svn-zombies.

What can you do? You can try to convert all the non-deads at once… or you can use git-svn and get them into git one by one.

git-svn let’s you interact with a svn server using git as your client. Some git GUIs support git svn. On Mac OSX you can use GitX(L) or SourceTree. Here is how to do it using the commandline.

To get a copy of your svn repo (assuming you have the de facto standard structure of trunk, branches and tags dirs) do:

git svn init -s http://path/to/your/svn/project

From here, use your local repo as usually, i.e. do some hacking, add your files and commit them. Rinse, repeat.

git add somefile 
git commit
...

When you are ready to commit your changes, get the changes from the svn repo:

git svn rebase

and commit your changes:

git svn dcommit

That’s it!

Comments