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://[email protected]*********************************.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

原文地址:https://www.cnblogs.com/qqhfeng/p/11192245.html

时间: 2024-10-08 00:33:57

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

执行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 not read from remote repository. Please make sure you have the correct access rights and the repository exists 解决方案: git remote add origin [email protec

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

1. fatal: 'origin' does not appear to be a git repository fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. 翻译: 致命:"origin"不是一个 git 存储库 致命:无法读取远程存储库 请确定你有正确的访问权力,并且 存储库存在

git报错:'fatal:remote origin already exists'怎么处理?附上git常用操作以及说明。

git添加远程库的时候有可能出现如下的错误, 怎么解决? 只要两步: 1.先删除 $ git remote rm origin 2.再次执行添加就可以了. ----------------------------------------------git常用操作------------------------------------------------ 说明,以下整理来自廖雪峰大神的<git教程>. 各位童鞋要下载git但是网速不给力的,可以从这里下载:https://pan.baidu.

git错误fatal: remote origin already exists.

输入 $git remote add origin https://github.com/用户名/项目.git,提示fatal: remote origin already exists.  解决办法: 1 .先输入$ git remote rm origin 2.再输入git remote add origin https://github.com/用户名/项目.git 原文地址:https://www.cnblogs.com/ding-daisy/p/9104548.html

【Git】fatal: remote origin already exists.

问题:fatal: remote origin already exists. 解答: $ git remote rm origin 再次执行下面的语句: $ git remote add origin https://github.com/... 原文地址:https://www.cnblogs.com/jums/p/11516692.html

Git push “fatal: Authentication failed ”

Git push "fatal: Authentication failed " 问题原因 之前设置了两步验证 If you enabled two-factor authentication in your Github account you won't be able to push via HTTPS using your accounts password. Instead you need to generate a personal access token. This

【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.223)' can't be established. RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8. Are you sure you want to continue connecting (yes

git服务端问题解决 fatal: No remote repository specified. Please, specify either a URL or a remote name from which new revisions should be fetched.

===== 下面的解决办法,可能只是适用于我遇到的这种情况,又想做钩子,又想恢复原先老人们配置的git的正常使用. ===== 因为是以前离职的员工配的,所以先检查一下原来的git能能正常使用不: 1.只有一条分支 master 2.版本库和项目目录是同一个,即 git clone [email protected]:/home/project 生产服务器上的项目目录也是: /home/project => 不知道 他们这么配的道理是什么. 3.在生产服务器上,执行 git pull,报告如下错

Push failed: Failed with error: fatal: Could not read from remote repository.

GitLab push远端,出现错误提示:Push failed: Failed with error: fatal: Could not read from remote repository. 原因: 1,账号无push的权限. 2,请添加一个正确的sshKey 添加方法: ssh-keygen -t rsa -C "账号" cat ~/.ssh/id_rsa.pub 将ssh保存到 GitLab即可