git ssh 不工作

git ssh doesn't work

我已经按照文档中的说明进行操作,当我输入 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/*

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

将存储库的 url 更改为 git@github.com:fifiteen82726/MFA.git

例如。命令 git remote set-url origin git@github.com:fifiteen82726/MFA.git

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