我已完成文档所说的内容,当我输入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
时,仍然需要username
和password
。为什么呢?
这是我的.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/*
答案 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/