GIT-SVN clone command executes without errors but the local master branch is missing

江枫思渺然 提交于 2020-01-31 05:31:09

问题


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


回答1:


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




回答2:


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




回答3:


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



来源:https://stackoverflow.com/questions/3318278/git-svn-clone-command-executes-without-errors-but-the-local-master-branch-is-mis

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!