I was dealing with a problem of converting existing Subversion repository to a new git repository on my local Windows XP station.I carefully followed steps described here:
C:\Program Files\Git\bin>git svn init -s file:///D:/path/to/svn/repository Initialized empty Git repository in C:/Program Files/Git/bin/.git/
But Ooops! Error occurred when I tried to fetch all the history to Git repository:
C:\Program Files\Git\bin>git svn fetch A notes.txt A pages.txt A settings.config r7 = f3dba0984f11e2f358923c23d89440789eb4591b (refs/remotes/references) Permission denied: Can't open '/tmp/report.tmp': Permission denied at C:\Program Files\Git/libexec/git-core/git-svn line 2723
It was an misguiding error since I had neither a “tmp” directory in the original svn repository nor “report.tmp” directory. For my surprise the problem was caused by different formats used by in original Subversion repository and by Subversion module included in my Git instance that probably uses older Subversion format. I use Git 1.6.5.1.1367.gcd48 that probably has Subversion module supporting format 4 but my Subversion repository was in format 5.
Solution
Luckily the solution for such WTF exists. If I access Subversion repository via SVN server instead of directly via file path problem will not occur. Thus, at first it is necessary to run SVN server:
svnserve.exe -d -r D:/parent/path/to/repository/
And then you can access Subversion repository via its server:
git.exe svn init -s "svn://localhost/relative/path/to/subversion/repository"