GitBash不断提示我输入GitHub的用户名和密码

问题描述:

我一直在使用gitbash来处理github,但每当我推或拉时,都必须在新提示中输入我的github用户名和密码。GitBash不断提示我输入GitHub的用户名和密码

我试图使用ssh来克隆github上代表://而不是https://开头,但是当我输入这样的:

混帐克隆SSH://github.com/user/repo.git我得到如下:

$ git clone ssh://github.com/user/repo.git 
Cloning into 'repo'... 
The authenticity of host 'github.com (192.30.253.112)' can't be established. 
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8. 
Are you sure you want to continue connecting (yes/no)? yes 
Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of  known hosts. 
Permission denied (publickey). 
fatal: Could not read from remote repository. 

请确保您有正确的访问权限 和库中存在。

您试图使用HTTPS而不是ssh进行克隆。

SSH连接会是这样的

[email protected]:域/ repositoryName.git

你可以看看的ssh连接点击克隆或下载选项卡上有,你会发现选项使用ssh。

+0

谢谢我以前没有看到它。我不得不在github上添加我的ssh密钥,就是这样。它现在有效! – mishke