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

fatal:'origin' does not appear to be a git repository fatal:Could not read from remote repository的更多相关文章

  1. 执行git命令时出现fatal: 'origin' does not appear to be a git repository错误

    在执行git pull origin master时出现: fatal: 'origin' does not appear to be a git repository fatal: Could no ...

  2. linux git 报错提示 fatal: 'origin' does not appear to be a git repository 解决办法

    输入: git pull origin master git报错提示 fatal: 'origin' does not appear to be a git repository fatal: Cou ...

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

    当使用Git进行代码push提交时,出现报错信息“fatal: 'origin' does not appear to be a git repository...”, $ git push -u o ...

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

    git push时报以下错误: fatal: 'origin' does not appear to be a git repository fatal: Could not read from re ...

  5. 推送代码分支时出现:fatal: 'origin' does not appear to be a git repository

    关于ubuntu进行提交本地分支到远程库出现问题: 解决方案: 执行如下命令: git remote add origin git@github.com:yourusername/test.git y ...

  6. git pull fatal: refusing to merge unrelated histories

    1.首先我github有个远程仓库,然后我本地有个仓库 本地仓库我新添加了一个文件,然后我去关联(git remote add origin git@github.com:qshilary/gitte ...

  7. Git 提示fatal: remote origin already exists

    Git 提示fatal: remote origin already exists 错误解决办法 最后找到解决办法如下: 1.先删除远程 Git 仓库 $ git remote rm origin 2 ...

  8. remote: Repository not found. fatal: repository 'https://github.com/***/***.git/' not found

    通过命令添加新repository到git hub在执行最后一步命令(如下所示)的时候报错 git push -u origin master error:remote: Repository not ...

  9. 【git基础】Permission denied (publickey). fatal: Could not read from remote repository

    运行以下git命令的时候出现错误 git push -u origin master error The authenticity of host 'github.com (13.250.177.22 ...

随机推荐

  1. 第06组 Beta版本演示

    队名:福大帮 组长博客链接: https://www.cnblogs.com/mhq-mhq/p/12052263.html 作业博客 : https://edu.cnblogs.com/campus ...

  2. 【mybatis源码学习】mybatis的插件功能

    一.mybatis的插件功能可拦截的目标 org.apache.ibatis.executor.parameter.ParameterHandler org.apache.ibatis.executo ...

  3. k8s 传参给docker env command、args和dockerfile中的entrypoint、cmd之间的关系

    [k8s]args指令案例-彻底理解docker entrypoint     需求: 搞个镜像,可以运行java -jar xxx.jar包,xxx.jar包名称要用参数传 思路1: 打对应运行ja ...

  4. 已知X,Y独立,那么X^2与Y也独立

    考虑离散情况,  P{X^2=k} => P{X=sqrt(k)} 由X,Y独立可知, P{X=Sqrt(k}  | Y=y} =P{X=Sqrt(x)}, P{X^2=k | Y=y} =P{ ...

  5. 如何获取select下拉框中option选中的文本值

    $(select的id或者class).change(function(){ $(this).find("option:selected").text() }) 源文:https: ...

  6. spark streaming 流式计算---跨batch连接池共享(JVM共享连接池)

    在流式计算过程中,难免会连接第三方存储平台(redis,mysql...).在操作过程中,大部分情况是在foreachPartition/mapPartition算子中做连接操作.每一个分区只需要连接 ...

  7. 服务器推送(Server push)技术总结

    1. 短轮询 ajax按一定间隔去请求 2. 长轮询(long Polling) Long Polling的实现很简单,可分为四个过程: 发起Polling发起Polling很简单,只需向服务器发起请 ...

  8. Qt编写图片及视频TCP/UDP网络传输

    一.前言 很多年前就做过类似的项目,无非就是将本地的图片上传到服务器,就这么简单,其实用http的post上传比较简单容易,无需自定义协议,直接设置好二进制数据即可,而采用TCP或者UDP通信的话,必 ...

  9. Windows 7安装Service Pack 1失败问题

    问题 很多朋友在电脑上安装某些软件时,会发现安装不了,提示信息大多是"本软件只支持 Windows 7 SP1 及更新版本"等等.这说明,你的电脑仍然在运行最早的Windows7版 ...

  10. java注解简单使用

    java注解可以比喻成标签,可以贴在任何地方,也可以限制只能贴在固定地方,比如类上方.方法上方.属性[字段]上方等,然后通过反射,判断是否存在这个注解. 注解形式 public @interface ...