天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. centos7安装mysql8 ERROR! The server quit without updating PID file

    原因mysql的安装目录在/etc/my.cnf配置不正确或者目录中的文件没有权限导致的,或者日志目录没有权限导致的 使用chwon -R mysql:mysql  mysql的日志目录后重启mysq ...

  2. IntelliJ IDEA 2018.2,WebStorm 2018.2破解

    一.IntelliJ IDEA 2018.2.4破解: 可参考:https://www.cnblogs.com/iathanasy/p/9469280.html 二.WebStorm 2018.2.4 ...

  3. Java实现Txt转PDF文件

    TxT转PDF可以直接使用IText就可以了,IText在pdf领域可以说暂时是最好的方案了.通过直接读取txt文件,然后生成pdf,再添加文本就可以了. 代码如下: public class Txt ...

  4. Python 拼接字符串的几种方式

    在学习Python(3x)的过程中,在拼接字符串的时候遇到了些问题,所以抽点时间整理一下Python 拼接字符串的几种方式. 方式1,使用加号(+)连接,使用加号连接各个变量或者元素必须是字符串类型( ...

  5. 安装tensorflow2.0

    pip install tensorflow==2.0.0 -i https://pypi.tuna.tsinghua.edu.cn/simple import tensorflow as tfpri ...

  6. [转]nodejs导出word

    转载自:https://blog.51cto.com/13803916/2133602 需要先下载依赖: npm install officegen 亲测可用: var officegen = req ...

  7. 【tensorflow基础】ubuntu-tensorflow可视化工具tensorboard-No dashboards are active for the current data set.

    前言 今天基于tensorflow训练一个检测模型,本应看到训练曲线的,却只见到一个文件events.out.tfevents.1570520647.hostname,后来发现这个文件可以查看训练曲线 ...

  8. [LeetCode] 875. Koko Eating Bananas 可可吃香蕉

    Koko loves to eat bananas.  There are N piles of bananas, the i-th pile has piles[i] bananas.  The g ...

  9. HLSL Shader编程基础总结

    转自:https://blog.csdn.net/Blues1021/article/details/47093487 基本前提概念 Shader是一种映射到GPU硬件汇编语言上的高级语言,Shade ...

  10. linux echo -e 处理特殊字符

    linux echo -e 处理特殊字符 若字符串中出现以下字符,则特别加以处理,而不会将它当成一般文字输出:\a 发出警告声:\b 删除前一个字符:\c 最后不加上换行符号:\f 换行但光标仍旧停留 ...