zoukankan      html  css  js  c++  java
  • fatal:'origin' does not appear to be a git repository fatal:Could not read from remote repository

    天gitlab中遇到的问题:

    当 git push origin branch_name时遇到报错如下:

    fatal:'origin' does not appear to be a git repository

    fatal:Could not read from remote repository

    原因:

    本地分支和远程分支断开连接

    解决方法:

    cd 本地分支里
    1、git branch
                   ——*master   只显示master

    然后查看是否从上游拉了
    2、git remote –v
                 ——若什么都没有,则和上游已断联系,拉不了代码也推不了代码


    加关联
    3、git remote add origin ssh://git@gitlab*********************************.git(地址)


    然后
    4、git fetch origin

                  ——会显示下拉的branch情况

                        格式为From ssh://gitlab.********************************

                      *  [new branch]         XXXXX        ->origin/XXXXX
     
    再次检查远程仓库,显示对应的clone地址
    git remote –v
    ——origin  git://github.com/schacon/ticgit.git (fetch)
    origin  git://github.com/schacon/ticgit.git (push)
     
    然后再查分支
    git branch –a

                ——* mater

                       remotes/origin/XXXXXX         **********

    具体的切换分支可参考https://blog.csdn.net/tanningzhong/article/details/79724488

    git 重命名仓库、修改远程仓库地址、修改仓库配置可参考:https://blog.csdn.net/u011884440/article/details/71246572

     
    ---------------------
    作者:huanhuaqian
    来源:CSDN
    原文:https://blog.csdn.net/huanhuaqian/article/details/81986064
    版权声明:本文为博主原创文章,转载请附上博文链接!

  • 相关阅读:
    人月神话
    Rails 最佳实践
    萧伯纳名言名句大全
    听话,照做,执行,别发挥
    So Good They Can't Ignore You
    谈谈遵守公司作战纪律
    如何让自己有动力去长久地做一件事情
    新架构优化问题总结
    Markdown 入门
    关于代码版本管理的思考和建议
  • 原文地址:https://www.cnblogs.com/qqhfeng/p/11192245.html
Copyright © 2011-2022 走看看