首页 > 技术文章 > git错误:fatal: Could not read from remote repository.解决

lovebkj 2020-08-12 11:03 原文

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地址。

以上。

推荐阅读