ERROR: Repository not found. fatal: 无法读取远程仓库。 然后再次输入:remote add origin git@github.com:duoduosel...

把练习作业上传到 Github过程中出现的错误


新repository

上传命令

git remote add origin git@github.com:duoduosell/rails101-1.git

本应该是rails101,名字错了,导致:

git push -u origin master错误返回:

ERROR: Repository not found.

fatal: 无法读取远程仓库。

然后再次输入:remote add origin git@github.com:duoduosell/rails101.git

fatal: 远程 origin 已经存在


先 git remote -v 查看远程库信息:



解决办法如下:

1、先输入$ git remote rm origin(删除关联的origin的远程库)

2、再输入$ git remote add origin git@github.com:(github名)/(git项目名).git 就不会报错了!

3、如果输入$ git remote rm origin 还是报错的话,error: Could not remove config section 'remote.origin'. 我们需要修改gitconfig文件的内容

4、找到你的github的安装路径,我的是C:\Users\ASUS\AppData\Local\GitHub\PortableGit_ca477551eeb4aea0e4ae9fcd3358bd96720bb5c8\etc

5、找到一个名为gitconfig的文件,打开它把里面的[remote "origin"]那一行删掉就好了!

---------------------

来源:CSDN

原文:https://blog.csdn.net/qq_40428678/article/details/84074207

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容