1. 程式人生 > >[Git]Please make sure you have the correct access rights and the repository exists

[Git]Please make sure you have the correct access rights and the repository exists

perm not 配置 兩個 需要 acc repos http 機器

這個問題是這樣,需要在已有github賬號的A機器上,再創建一個github賬號,新賬號創建完畢,將代碼通過機器A push上之後,再另一臺機器B,clone 這個項目時報出了如下錯誤:

Permission denied (publickey).
fatal: Could not read from remote repository.

解決方式是:

在clone代碼的時候要使用https的形式。

https://github.com/accountName/projectname.git

另外,在機器A上配置兩個git賬戶,需要重新生成sshkey,並且要將這兩個github賬戶的ssh文件進行區分 id_rsa_old / id_rsa_new ,其次要通過配置文件對這兩個賬號進行配置,在使用的時候切換比較方便。

類似的教程,網上資源很多,多參考幾個文檔即可。

[Git]Please make sure you have the correct access rights and the repository exists