解决“fatal: 'origin' does not appear to be a git repository...”

用家里的电脑,pull下的代码,修改后,push 出现这种错误

$ git push -u origin master
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.

解决办法:

原因是origin不存在或者是错的。查看远程仓库名称以及路径相关信息,如果没有,就填加远程库,如果是错的就删除后,再添加对的

git remote -v                                           查看远程仓库详细信息,可以看到仓库名称

git remote remove origin                       删除orign仓库(如果把origin拼写成orign,删除错误名称仓库)

git remote add origin 仓库地址             重新添加远程仓库地址

gti push -u origin master                      提交到远程仓库的master主干

 

 

posted @ 2020-02-25 23:19  不明白就去明白  阅读(2379)  评论(0编辑  收藏  举报