git ssh不起作用

时间:2015-06-16 05:01:34

标签: git ssh

我已完成文档所说的内容,当我输入ssh -T git@github.com时, 它会显示

Warning: Permanently added the RSA host key for IP address '[192.30.252.149]:443
' to the list of known hosts.
Hi fifiteen82726! You've successfully authenticated, but GitHub does not provide
 shell access.

但是,当我想将某些内容推送到github时,仍然需要usernamepassword。为什么呢?

更新

这是我的.git/config

[core]
        repositoryformatversion = 0
        filemode = false
        bare = false
        logallrefupdates = true
        symlinks = false
        ignorecase = true
        hideDotFiles = dotGitOnly
[remote "origin"]
        url = https://github.com/fifiteen82726/MFA.git
        fetch = +refs/heads/*:refs/remotes/origin/*

1 个答案:

答案 0 :(得分:8)

您正在使用HTTPS协议而不是SSH。

将存储库的网址更改为git remote set-url origin git@github.com:fifiteen82726/MFA.git

实施例。命令{{1}}

这里是GitHub帮助页面,描述了如何获取不同协议的地址https://help.github.com/articles/which-remote-url-should-i-use/