U P D A T E — July 24, 2009
Thankfully, I don’t have to use the solution below anymore. It was really confusing to SVN when I switched between branches. I accidentally fixed it while solving another problem…
SVN wasn’t able to check out externals either, which looked like a completely different issue. It turned out it was using my username on my mac instead of the one I had set in the repo URL, and I fixed it by creating a file ~/.ssh/config and including the following:
Host worksvnserver.com
User myusername
A few days later I made another attempt with git-svn and it worked!
The Problem
At my new job we use subversion. It’s relatively new to everyone, so getting people to switch to git isn’t going to happen soon. Enter git-svn for my git-lovin’ self, right? So I try this:
git svn clone -s svn+ssh://myusername@worksvnserver/svn/project
Which gives me this:
Initialized empty Git repository in .git/
Using higher level of URL: svn+ssh://myusername@worksvnserver.com/svn/project => svn+ssh://myusername@worksvnserver.com/svn
ssh: connect to host worksvnserver.com port 22: Connection refused
ssh: connect to host worksvnserver.com port 22: Connection refused
svn-remote.svn.url already set: svn+ssh://myusername@worksvnserver.com/svn
wanted to set to: svn+ssh://myusername@worksvnserver.com/svn/project
I have my public ssh key up on the svn server, so I should make sure it works with plain ol’ svn:
svn co svn+ssh://myusername@worksvnserver.com/svn/project/trunk project
…And that works just fine. Google can’t seem to find anyone else with this problem, and not being much of a server-admin type person myself, I’m left to find a workaround.
The Workaround
My Plan is to do a regular svn checkout and then initialize it as a git repo also. I’m not going to get the branch/tag management that I’d get with git-svn, but I’m hoping I won’t need it much. Aside from that, I’m not sure what the advantage is to using git-svn over the following.
First I set my global svn ignore configuration to ignore .git*, and add .svn to my global git ignore. After which I do something like this:
svn co svn+ssh://myusername@worksvnserver.com/svn/project/trunk project
cd project
git init
*hack hack*
*git stuff*
*all good?*
svn ci
So…
I’m sure there are some good reasons not to do this, so before I get too deep, can anyone tell me why?
Also, I’m using SVNMate with TextMate, so I assume there will be some problems with that… but then, I don’t know how it would have worked with git-svn either.