6

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
  • as a note, getting this partial download folder "without branches" in it, for me, meant "don't run git svn clone -s" (-s == --stdlayout). Run it without "-s" then it worked. weird.and git didn't even complain it just created the bunked directory... Commented Jan 25, 2013 at 17:26
  • Were you doing git svn init and git svn fetch from inside the already existing svn directory? Commented Apr 15, 2016 at 15:10

3 Answers 3

9

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

Sign up to request clarification or add additional context in comments.

Comments

4

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

1 Comment

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 '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
0

I had a similar Problem with git svn clone but in my case it (slightly hidden) printed an error. Due to the user name it was not obvious what was meant. But essentially an author's name (or better :SVN-user name) was missing in my authors.txt

that solved it

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.