Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.gitmodules为何要是git@github.com这种ssh的格式? #67

Closed
rexdf opened this issue Oct 11, 2016 · 6 comments
Closed

.gitmodules为何要是git@github.com这种ssh的格式? #67

rexdf opened this issue Oct 11, 2016 · 6 comments

Comments

@rexdf
Copy link

rexdf commented Oct 11, 2016

url = git@github.com:lotem/librime.git

这句话的意思应该是:使用ssh协议,从github.com主机上以git用户名登录,获取lotem/librime.git文件夹。

而非授权用户根本没法访问的。

也就是必须要有lotem用户的私钥的才可能git submodule update --init成功。

同样的道理,在INSTALL.md里面也是git clone git@github.com:lotem/weasel.git这句话是有读写权限的人(可以是项目协作者)才能执行成功的。

@lotem
Copy link
Member

lotem commented Oct 11, 2016

好的。讓我來更新一下。

@Prcuvu
Copy link
Contributor

Prcuvu commented Oct 11, 2016

理论上SSH不需要仓库所有者的私钥,只要你的GitHub用户绑定了SSH密钥,就可以通过SSH方式clone所有公开的仓库。
如果真的有问题,那么只要更新成git@github.com:rime/librime.git就可以了?

@lotem
Copy link
Member

lotem commented Oct 11, 2016

@lotem lotem closed this as completed Oct 11, 2016
@Prcuvu
Copy link
Contributor

Prcuvu commented Oct 12, 2016

2016-10-11_105413
我这里用SSH可以正常clone。

@rexdf
Copy link
Author

rexdf commented Oct 12, 2016

我的都是如下,电信的。

D:\tmp>git clone git@github.com:lotem/librime.git
Cloning into 'librime'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

D:\tmp>git clone http://github.com/lotem/librime.git
Cloning into 'librime'...
remote: Counting objects: 13015, done.
^Cceiving objects:   9% (1255/13015), 1.95 MiB | 528.00 KiB/s

这个倒是我搞错了 我没有在windows客户端配置git的密钥,因为要push我都是用的cygwin。 像这样要用密钥才能pull比较麻烦,我还是觉得https的比较好。貌似stack overflow提这个问题比较多,然后就是自动build bot可能也会遇到git clone git@github.com:麻烦。

@Prcuvu
Copy link
Contributor

Prcuvu commented Oct 13, 2016

我这边用HTTPS会有connection refused的错误,而SSH的连接是稳定的。不过,如果要把这个项目放到AppVeyor CI,HTTPS就是合适的选择。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants