首页 > 解决方案 > git clone 问题 [套接字:协议不支持地址族]

问题描述

我在共享主机上(巨大的错误)。我已经 ssh 进入它并尝试从 bitbucket.org 克隆一个私有存储库:

git clone git@example.com:MyStuff/private-repository.git

但面临这个问题:

套接字:协议不支持的地址族

ssh:连接到主机 bitbucket.org 端口 22:协议不支持的地址系列

现在看这个页面:https ://forums.gentoo.org/viewtopic-t-127306-start-0.html 。我想也许我需要通过 ssh 禁用 ipv6 来连接到主机。我不能这样做(共享主机)。

有什么帮助吗?

标签: gitsocketssshcpanelshared-hosting

解决方案


在这种情况下,我会在 SSL 上使用克隆,就像这样

git clone https://<repo-url>

如果您不想每次都输入密码,那么另一个不错的技巧是,您可以像这样使用凭证助手:

git config --global credential.helper cache
git config --global credential.https://github.com.username foo
git clone https://github.com/foo/repository.git

以上将导致 Git 每 15 分钟询问一次您的密码(默认情况下)。


推荐阅读