2017-02-12 135 views
1

我一直在使用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. 

請確保您有正確的訪問權限 和庫中存在。

回答

1

您試圖使用HTTPS而不是ssh進行克隆。

SSH連接會是這樣的

[email protected]:域/ repositoryName.git

你可以看看的ssh連接點擊克隆或下載選項卡上有,你會發現選項使用ssh。

+0

謝謝我以前沒有看到它。我不得不在github上添加我的ssh密鑰,就是這樣。它現在有效! – mishke

相關問題