所以我将我的公共 ssh 密钥添加到 git 存储库中。我已将私钥添加到我的 /c/Users/totty/.ssh/。
当我运行ssh -vT git@github.com
它说Hi X! You've successfully authenticated, but GitHub does not provide shell access.
当我跑步时,git push origin
我得到Permission to * denied fatal: Could not read from remote repository
这个github有什么问题?我无法从 cmd、git 扩展中推送。但它可以从 Windows 的 github 工作...
删除我的 ssh 密钥并运行后, ssh -vT git@github.com
我得到debug1: No more authentication methods to try.
.
Also another thing that is strange... if you look at the circled text, that's not my username or email anywhere. I even check in my git config and is nowhere. Where is coming from? I mean gs11118
首先,用户名/电子邮件(您使用git config user.name
/设置的user.email
用户名/电子邮件)与 GitHub 凭据(用户 GitHub 帐户名)无关
其次,确保您的 git Push 实际上使用 SSH URL:
cd /path/to/my/local/repo
git remote -v
Run Code Online (Sandbox Code Playgroud)
如果您看到以 开头的 URL https://...
,那么它是否正确识别您并不重要ssh -T git@github.com
:Git 不会将其用作凭据。它将使用Windows 凭据管理器中存储的内容。