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
    版权声明:本文为博主原创文章,转载请附上博文链接!

  • 相关阅读:
    CentOS挂载ntfs
    搬水果
    CentOS安装完显卡启动进不去系统
    二叉树遍历
    拓展的异常类
    Visual Studio 2008 IDE 出现 “帮助更新正在进行”错误的解决办法
    JSON工具SuperObject编译时"整数溢出"异常的解决办法
    引用命名区域
    ruby操作excel的几段代码
    Delphi2009&2007中,测试工程的初级使用(DUnit)
  • 原文地址:https://www.cnblogs.com/qqhfeng/p/11192245.html
Copyright © 2011-2022 走看看