天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. 反向传播BP算法

    前向传播模型 一般我们使用的公式是: \[ a=\frac{1}{1+\exp \left(-\left(w^{T} x+b\right)\right)} = \frac{1}{1+\exp \lef ...

  2. Java内存模型与Volatile,Happen-Before原则等

     Java的内存模型 Java内存模型(JMM)是一个抽象的模型.决定了线程主要定义了线程和内存间的抽象关系:主内存存放的是线程共享变量,每个线程有自己的工作内存,存放变量的副本,只能对副本进行读写, ...

  3. flask 实现最简单的登录功能

    视图函数如下: # Sample.py from flask import Flask, render_template, url_for, request, redirect app = Flask ...

  4. pypy安装与使用

    首先安装pypy环境: yum install pypy -y yum install pypy-devel -y 然后安装pypy的pip:wget https://bootstrap.pypa.i ...

  5. 014 ThreadLocal详解

    一:ThreadLocal的原理 1.说明 ThreadLocal从字面意思来理解,是一个线程本地变量,也可以叫线程本地变量存储.有时候一个对象的变量会被多个线程所访问,这个时候就会有线程安全问题,当 ...

  6. Xamarin图表开发基础教程(7)OxyPlot框架

    Xamarin图表开发基础教程(7)OxyPlot框架 Xamarin.Forms中使用OxyPlot框架 在Xamarin. Forms平台上实现图表显示需要完成以下的步骤: 1.添加OxyPlot ...

  7. [转]Maven 全局配置文件settings.xml详解

    原文地址:https://www.jianshu.com/p/110d897a5442 概要 settings.xml有什么用? 如果在Eclipse中使用过Maven插件,想必会有这个经验:配置se ...

  8. Redis慢日志查询

    Redis slowlog 是个什么 redis的slow log记录了那些执行时间超过规定时长的请求.执行时间不包括I/O操作(比如与客户端进行网络通信等),只是命令的实际执行时间(期间线程会被阻塞 ...

  9. osg指定向量旋转指定角度

    向量AB,沿着n旋转10度 osg::Vec3 left = AB*osg::Matrix::rotate(osg::inDegrees(10), n); osg::Vec3 right = AB*o ...

  10. flex布局大全 2019

    有句话叫做:存在即是合理. 最近很喜欢flex布局模式,不过还在摸索中,这里正一边在项目中使用和总结,也在学习一些大牛们总结的东西和布局思考. 鉴于自己很苦恼,到处去ha资料,真的,就没有一个系统的, ...