I received a simple assignment: move our svn repository to git.
You can
skip to the end and read the steps to take or read the boring story that led to this blog post.
I thought it shouldn't be hard since our repository is local and you have
git-svn. Well it's not that easy as well.
I must admit, I am lazy. I don't want to do it in batch mode and I don't want to be the master of git and svn to accomplish this. At the end I was forced to work in batch mode most of the time.
So I started by doing a simple google search and found the following blog:
Cleanly migrate your svn repository
Sounds promising!
My repository is located at C:\SVNRep so I typed:
git svn c:\svnrep --no-metadata
Wrong!
Once I issued the: "git fetch" I was warned that it could not find the svn repository.
Back to searching. Now I found
this answer on StackOverFlow. I understood I am an idiot. No surprise there...
I tried to issue the following:
git svn file://c:/svnrep --no-metadata
The process started and I was happy. BUT, I received another error: similar to "Permission denied: error line 2723" with a tmp folder that was not in my svn repository. Google dug an answer quite fast with this message:
Porting svn with an error
I thought I was done, but apparently I am not that talented when it comes to svn.
I downloaded the svn version I created the repository with (1.6.5) and ran the svnserve command only to find that git did not find the path I specified (svn://localhost/relative/svnrep/). I then downloaded
VisualSVN, copied my repository to the repositories directory and created a user with the same name as the Windows user. I was now able to access my repository through the web with the user I created. So.... once again I hit:
git init http://shay-vm-git/svn/SVNRep/ --no-metadata
This time it worked!!! The process takes along time to finish.
To summarize:
System settings -
- Windows XP SP3
- VisualSVN with SVN 1.6.5
- Git-1.6.5.1-preview20091022.exe
Objective -
Steps to take-
- Read Cleanly migrate your svn repository
- Read Porting svn with an error
- Install VisualSVN that corresponds to the SVN version of your svn repository
- Create a user in VisualSVN with the same name of the user you are logged-on with in Windows
- Copy your repository to the Repositories folder of VisualSVN
- Right click the repository folder in VisualSVN and choose Browse
- Copy the URL of your repository from the web page that opened and use it in the "git init svn_address --no-metadata" command
- Wait a long time for the fetch to finish
Hope this helped someone.