git錯誤:fatal: Could not read from remote repository.解決


D:\dev\dev_py\git-lab\test-pro>git push
remote:
remote: ========================================================================
remote:
remote: Internal API unreachable
remote:
remote: ========================================================================
remote:
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

出現上述錯誤的原因是:運維將公司一台機子上的git私有倉庫遷移至另一台機子上了,導致之前對原先的機子上的代碼提交失效,沒有權限。

解決步驟:

1、重新生成公鑰,寫入新機子中的gitlab。公鑰生成:ssh-keygen -t rsa -b 4096 -C "email@example.com"

2、公鑰私鑰本地存放的路徑一般為:C:\Users\用戶名\.ssh

3、將id_rsa.pub的內容加入自己的賬號設置中的SSH密鑰即可

4、修改自己本地工程的git倉庫中的.git/config文件,在url位置修改ip地址。

以上。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM