GitHub部署密钥 - ssh -T git@github.com成功但git pull仍然要求输入密码

时间:2015-05-30 16:40:18

标签: git github deployment

我正在尝试将部署密钥添加到我的github存储库中。 存储库是私有的。 我已经为存储库添加了github的密钥,然后运行了以下命令。

ReferenceError: zombie is not defined
    at Object.<anonymous> (/home/martin/zombie/1.js:1:87)
    at Module._compile (module.js:410:26)

然后我收到了回复......

ssh -T git@github.com

这表明它已成功运作......然后我尝试以下

The authenticity of host 'github.com (192.30.252.128)' can't be established.
RSA key fingerprint is 11:22:aa:aa:11:22:33:44:55:66:77:88:99:00:11:22.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.252.128' (RSA) to the list of known hosts.
Hi Username/Project_Name! You've successfully authenticated, but GitHub does not provide shell access.

然后我得到了答复......

git pull

查看Username for 'https://github.com': 我看到以下几点对我来说没什么意义......

/var/log/auth.log

非常感谢任何帮助!

2 个答案:

答案 0 :(得分:0)

运行ssh -o StrictHostKeyChecking=no git@github.com以向known_hosts添加真实性。

它应该修复它

答案 1 :(得分:0)

Git支持各种协议与远程存储库通信,主要是HTTP,HTTPS,SSH和GIT。您可以在Pro Git一书中找到对这些协议的深入描述。用于远程的具体协议由用于描述它的URL确定。

git-push(1)列出了可用于git遥控器的URL格式:

  • HTTP(S):
    • http[s]://host.xz[:port]/path/to/repo.git/
  • SSH:
    • ssh://[user@]host.xz[:port]/path/to/repo.git/
    • [user@]host.xz:path/to/repo.git/

您可以通过执行以下命令获取远程URL:

$ git remote show <remote> -n

您正在尝试将SSH公钥基础结构与HTTPS远程配合使用,这就是它无法正常工作的原因。要解决此问题,请更改远程URL:

$ git remote set-url <remote> git@github.com:<user>/<repo>.git