cPanel 中的 GIT 存储库连接失败
Posted
技术标签:
【中文标题】cPanel 中的 GIT 存储库连接失败【英文标题】:GIT repo connection failed in cPanel 【发布时间】:2019-05-25 07:15:57 【问题描述】:我在将 git repo 连接到 cpanel 时遇到问题。我已将 SSH 密钥从 git 正确添加到 cPanel。有时回购正在连接,有时我遇到以下问题 错误:“/usr/local/cpanel/3rdparty/bin/git”结束时报告错误代码“128”:致命:无法读取“https://......@bitbucket.org”的密码:没有这样的设备或地址
提前谢谢你
【问题讨论】:
【参考方案1】:还要确认存储库是公开的,我刚遇到这个问题,并认为我的存储库是私有的,所以找不到它
【讨论】:
为什么会有这样的问题? SSH 密钥可以访问私有存储库【参考方案2】:我已将 SSH 密钥添加到 cPanel
那么您应该使用 SSH URL (git@server:user/repo
),而不是 HTTPS URL(以 https://.. 开头。)
请参阅 CPanel 知识库中的“Guide to Git - Set Up Access to Private Repositories”。
git clone git@example.com:MyStuff/private-repository.git
你can see here一个典型的BitBucket SSH URL:
git@bitbucket.org:<account_name>/<repo_name>.git
# or
ssh://git@bitbucket.org/<account_name>/<repo_name>.git
注意:BitBucket 存储库的用户名总是 git
。
【讨论】:
我遇到了另一个错误reported error code “128” when it ended: fatal: unable to look up git@bitbucket.org (port 9418) (Name or service not known)
@aswzen 端口 9418 是 git 协议的默认端口,用于以 git://
开头的 URL。确保使用实际的 SSH URL。以上是关于cPanel 中的 GIT 存储库连接失败的主要内容,如果未能解决你的问题,请参考以下文章