简体   繁体   English

如何使用subgit签出svn + ssh存储库?

[英]How to checkout svn+ssh repository with subgit?

I want to checkout the glassfish svn with subgit 2.0.2. 我想用subgit 2.0.2检出glassfish svn。

I added 我加了

ssh-rsa blabla user@host

in the user account settings of java.net. 在java.net的用户帐户设置中。 The key is stored locally under ~/.ssh/authorized_keys and id_rsa.user@host.pub . 密钥存储在本地~/.ssh/authorized_keysid_rsa.user@host.pub

I set up subgit with subgit configure --svn-url svn+ssh://javauser@svn.java.net/glassfish~svn /path/to/folder and changed /path/to/folder/config to 我用subgit configure --svn-url svn+ssh://javauser@svn.java.net/glassfish~svn /path/to/folder设置了subgit ,并将/path/to/folder/config更改为

[core]
    repositoryformatversion = 0
    filemode = true
    bare = true
    logallrefupdates = false
    bigFileThreshold = 1m

[svn]
    url =  svn+ssh://javauser@svn.java.net/glassfish~svn 

[auth "default"]
    sshKeyFile = /home/user/.ssh/id_rsa.user@host.pub

subgit install /path/to/folder fails due to error: svn: E170001: Authentication required for 'javauser@svn+ssh://svn.java.net' . subgit install /path/to/folder由于error: svn: E170001: Authentication required for 'javauser@svn+ssh://svn.java.net'而失败error: svn: E170001: Authentication required for 'javauser@svn+ssh://svn.java.net'

Edit 1 and 3: I want to checkout with svn+ssh because with svn and https I'm getting 编辑1和3:我想用svn+ssh结帐,因为有了svnhttps

  • error: svn: E175002: PROPFIND of '/': 405 Method Not Allowed (https://svn.java.net) or error: svn: E175002: PROPFIND of '/': 405 Method Not Allowed (https://svn.java.net)
  • error: svn: E175002: PROPFIND of '/svn/glassfish~svn': 502 Proxy Error (https://svn.java.net)

after different periods of time (sometime immediately, sometimes after days (it's a large checkout...), but I never managed to checkout/clone completely), with http I'm getting relocation error because the server enforces https this way. 在不同的时间段之后(有时立即,有时几天后(这是一个很大的结帐...),但我从未设法完全结帐/克隆),使用http我收到了重定位错误,因为服务器以这种方式强制执行https

Edit 2: When I invoke ssh javauser@svn.java.net and ssh javauser@java.net I'm getting Permission denied (publickey). 编辑2:当我调用ssh javauser@svn.java.netssh javauser@java.net我的Permission denied (publickey). and I'm not sure whether this is intended, because I guess I shouldn't be able to login on the java.net server or whether the key isn't working. 而且我不确定这是否是故意的,因为我想我不应该能够在java.net服务器上登录或者密钥是否不起作用。

EDIT 3: java.net seems to let all REPORT requests (I'm not too familiar with svn , maybe that's very rare and relies on some extension of underlying protocoll which get stuck in a misconfigured firewall - why else could it timeout always on REPORT requests?) making it impossible to checkout even with svn . 编辑3: java.net似乎让所有REPORT请求(我不太熟悉svn ,也许这是非常罕见的,并且依赖于底层协议的某些扩展,这些扩展卡在配置错误的防火墙中-为什么否则它总是在REPORT上超时要求?)即使使用svn也无法结帐。

It looks like subgit isn't using your SSH key for the authorization. 看来subgit没有使用您的SSH密钥进行授权。

I guess you have to specify the auth value for the svn configuration, although one could assume that it is using the default by default. 我猜您必须为svn配置指定auth值,尽管可以假设default情况下使用default值。 Try the following: 请尝试以下操作:

[svn]
    url = svn+ssh://javauser@svn.java.net/svn/glassfish~svn 
    auth = default

Update: I just realized that you are using the wrong URL. 更新:我只是意识到您使用了错误的URL。 It has to be: 它一定要是:

svn.java.net/ svn /glassfish~svn svn.java.net/ svn / glassfish〜svn

Update #2: 更新#2:

If you don't want to contribute to the repository an anonymous checkout is sufficient. 如果您不想对存储库做出贡献,那么匿名签出就足够了。 Try the following configuration: 尝试以下配置:

[svn]
    url = https://svn.java.net/svn/glassfish~svn
    auth = default

[auth "default"]

I tried that and it started, but it looks like it will take ages to complete. 我尝试过并开始了,但似乎需要一段时间才能完成。 Maybe it helps if only checkout something more specific like the GlassFish 4.0 branch (change the url to https://svn.java.net/svn/glassfish~svn/branches/4.0/ ). 如果仅检出更特定的内容(例如GlassFish 4.0分支)(将URL更改为https://svn.java.net/svn/glassfish~svn/branches/4.0/ ),则可能会有所帮助。

If this also doesn't work for you another option is to checkout the repository with svn (like it is supposed to). 如果这对您也不起作用,则另一种选择是使用svn签出存储库(就像应该的那样)。 The following should work (you need an svn client for that): 以下应该工作(您需要一个svn客户端):

svn checkout https://svn.java.net/svn/glassfish~svn /path/to/something

You can also do a local import of the svn checkout with subgit . 您还可以使用subgitsvn结帐进行本地导入。 Instructions can be found in the SubGit Book for Local Mode . 可以在SubGit本地模式手册中找到说明。

See also: 也可以看看:

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

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