Github身份验证失败 - ... GitHub不提供shell访问

Lut*_*Lut 14 git github ssh-keys

$ git remote add origin git@github.com:lut/EvolutionApp.git
fatal: remote origin already exists.

$ git push -u origin master
fatal: 'EvolutionApp' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Run Code Online (Sandbox Code Playgroud)

我的钥匙成功添加了

 $ ssh -T git@github.com
 Hi lut! You've successfully authenticated, but GitHub does not provide shell access.
Run Code Online (Sandbox Code Playgroud)

Github的文章https://help.github.com/articles/generating-ssh-keys/说"Shell访问"应该不是问题吗?问题是什么?

Von*_*onC 24

尝试并重新定义远程源的ssh url:

git remote set-url origin git@github.com:lut/EvolutionApp.git
Run Code Online (Sandbox Code Playgroud)

然后再试一次

  • @brohjoe 因为`ssh -T git@github.com` 只给你一条“欢迎”消息,*不是*交互式shell。 (2认同)

小智 19

您可以将其添加到~/.gitconfig文件中。

[url "ssh://git@github.com/"]
        insteadOf = https://github.com/
Run Code Online (Sandbox Code Playgroud)

现在将使用 ssh 而不是 https。