tags:

views:

147

answers:

2

I'm trying to use GIT-SVN but I'm having problems getting things started. I can clone the svn-repository (or use git svn init and then git svn fetch) without any errors but after the command stops processing, the git repository is empty and there's no local master branch.

My svn repository is located in here:

https://localhost:8443/svn/projects

And the project folder is structured like this: /projectA/trunk /projectA/branches /projectA/tags

/projectB/trunk /projectB/branches /projectB/tags

(note, branches and tags-folders are empty, trunk-folder contains files).

I'm trying to clone the projectA so I used this command:

git svn clone --username myUsername https://localhost:8443/svn/projects/ gitFolder --trunk projectA/trunk --branches projectA/branches --tags projectA/tags

The processing takes around 10 minutes and it outputs all the filenames to the screen. Last line looks like this:

r233 = 2bfb031dda74e0ae8340688892197d647729b256 (refs/remotes/trunk)

Now if I switch to gitFolder and type git log, I get: fatal: bad default revision 'HEAD'.

git branches -a reports this: remotes/trunk.

There's a .git folder in gitFolder but nothing else. I've also tried to to git svn init and git svn fetch instead of git svn clone but the end result is same.

Any ideas what's going on? Thanks in advance.

Update:

Just realized that the last line (r233 = 2bf...) must point to the revision number. So the last handled svn revision is 233. I've retested this multiple times and the git-svn clone always stops after the revision 233. The problem is that the original svn repository contains more than 10100 revisions. I'm not sure why git-svn is stopping before it should because there isn't any errors or warnings. Is there a log file somewhere which could give more clues?

Another update:

I was able to solve my problem. It was caused by the communications problems between the VisualSVN (version 2.1.3) and the Msysgit (version 1.7.0.2-preview20100309). It seems that at some point git-svn just loses the connection to the VisualSVN-server and fails to show the error and just closes down. Switching from http-protocol to svn-protocol fixed the problem.

Using svn-protocol with VisualSVN is quite easy:

  1. Go to the bin-folder of the VisualSVN
  2. Type "svnserve --daemon"

You can check that everything works by using the TortoiseSVN and pointing it to your repository: svn://localhost/repositories/myProject

+2  A: 

Looks all correct to me. Is the result the same if you do the following:

git svn clone --username myUsername https://localhost:8443/svn/projects/ gitFolder

turingmachine
If I try run the clone command like that, I get the following error: Initialized empty Git repository in c:/dev/projects/.git/error 0: REPORT request failed on '/svn/projects/!svn/vcc/default': Path 'https://localhost:8443/svn/projects' is not canonicalized; there is a problem with the client. at C:\Program Files\Git/libexec/git-core/git-svn line 5047
Mikael Koskinen
A: 

I was able to solve my problem. It was caused by the communications problems between the VisualSVN (version 2.1.3) and the Msysgit (version 1.7.0.2-preview20100309). It seems that at some point git-svn just loses the connection to the VisualSVN-server and fails to show the error and just closes down. Switching from http-protocol to svn-protocol fixed the problem.

Using svn-protocol with VisualSVN is quite easy:

Go to the bin-folder of the VisualSVN Type "svnserve --daemon" You can check that everything works by using the TortoiseSVN and pointing it to your repository: svn://localhost/repositories/myProject

Mikael Koskinen