简体   繁体   English

克隆Git的SVN存储库

[英]Cloning SVN repository for Git

I'm using SVN for source control which is hosted by a repository hosting company. 我正在使用SVN进行源代码管理,该托管由托管公司托管。 I'm considering migrating this to Git and testing the waters of migration by trying to migrate to a local Git instance. 我正在考虑将其迁移到Git并尝试迁移到本地Git实例来测试迁移水域。 I've installed Git Extensions v2.31 and installed the msysgit version that I was offered during the installation. 我已经安装了Git Extensions v2.31并安装了我在安装过程中提供的msysgit版本。

Once installed, I then clicked on the 'Clone SVN repository' option and entered in the SVN repo location and other necessary details. 安装完成后,我点击“克隆SVN存储库”选项并输入SVN仓库位置和其他必要的详细信息。 Clicked on the Clone button. 单击“克隆”按钮。 I was then presented with the following message in the Process output window (I've desensitised some info): 然后我在Process输出窗口中看到以下消息(我已经desensitised一些信息):

c:\Program Files (x86)\Git\bin\git.exe svn clone "https://foobar.domain.com/folder/name.svn" "c:/git/"
Initialized empty Git repository in c:/git/.git/
Error validating server certificate for 'https://foobar.domain.com:443':
 - The certificate is not issued by a trusted authority. Use the
   fingerprint to validate the certificate manually!
Certificate information:
 - Hostname: *.domain.com
 - Valid: from Mar 18 13:23:06 2012 GMT until Apr 20 16:16:05 2013 GMT
 - Issuer: GeoTrust, Inc., US
 - Fingerprint: a2:36:f0:ae:8c:c7:a3:f2:be:98:b3:0f:2e:f8:3a:07:9a:94:90:81

At this point nothing else gets displayed, the progress bar is still indicating progress but nothing really happens. 此时没有其他任何内容显示,进度条仍然显示进度但没有真正发生。 The issue seems similar to what is reported here: Git and SVN on Windows 问题似乎与此处报道的类似: Windows上的Git和SVN

However, I do not even get the option to reject/accept etc? 但是,我甚至没有选择拒绝/接受等? Anyone got any ideas? 有人有任何想法吗?

TIA TIA

You can still do this with Git Extensions. 您仍然可以使用Git Extensions执行此操作。 Open Git Bash from inside Git Extensions and run the command you saw it produce when using the GUI: git svn clone "https://foobar.domain.com/folder/name.svn" "c:/git/" This will provide you with the reject/accept temporarily/permanently options you see in the other SO question you linked to. 从Git Extensions中打开Git Bash并运行你在使用GUI时看到的命令: git svn clone "https://foobar.domain.com/folder/name.svn" "c:/git/"这将提供您使用拒绝/接受临时/永久选项,您在链接到的其他SO问题中看到。

If you've already tried the "Clone SVN Repository" option and never saw success as described, your local repo is actually already set up, just not populated with any of the files yet. 如果您已经尝试过“克隆SVN存储库”选项并且从未如上所述看到成功,那么您的本地存储库实际上已经设置好了,只是没有填充任何文件。 In this case, you no longer need to do a clone, just a fetch. 在这种情况下,您不再需要进行克隆,只需要进行提取。 Running git svn fetch on the project you tried to clone will also provide you with the reject/accept/etc options. 在您尝试克隆的项目上运行git svn fetch也将为您提供reject / accept / etc选项。

I would recomment you to try clone with SmartGit . 我建议您尝试使用SmartGit进行克隆。 Is has it's based on another engine, not git-svn or even SVN, so I think you won't get this problem. 它是基于另一个引擎,而不是git-svn甚至SVN,所以我认为你不会遇到这个问题。 There're some more reasons to prefer SmartGit: it translates such SVN concepts like branches, tags, ignores, EOLs to the corresponding Git concepts, git-svn doesn't. 还有更多的理由喜欢SmartGit:它将诸如分支,标签,忽略,EOL等SVN概念转换为相应的Git概念,而git-svn则没有。

If you don't mind using terminal and understand better how git works, I suggest you to use git bash . 如果你不介意使用终端并更好地了解git是如何工作的,我建议你使用git bash Otherwise you should use SmartGit by syntevo, because it also offers a different engine and key managements and, IMPO, it's the best GUI tool in Windows. 否则你应该通过syntevo使用SmartGit ,因为它还提供不同的引擎和密钥管理,而IMPO,它是Windows中最好的GUI工具。

Have a look at SmartGit . 看看SmartGit Its SVN integration supports more features than git-svn and it's built upon a different SVN client library which usually handles the various authentication scenarios quite well. 它的SVN集成支持比git-svn更多的功能,它基于不同的SVN客户端库,通常可以很好地处理各种身份验证方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM