目录

解决办法


最近不知道做了什么操作。发现git pull 的时候报错 Your configuration specifies to merge with the ref XXXX。如下

> git pull
Your configuration specifies to merge with the ref 'refs/heads/some_master'
from the remote, but no such ref was fetched. 

使用git branch -a 看不到远程分支。(本例解决办法)

>git branch -a* some_master
(END)

按网上的说法,是本地分支和远程分支对不上了。于是我使用

vim .git/config

查看分支是否正确

[core]repositoryformatversion = 0filemode = falsebare = falselogallrefupdates = trueignorecase = true
[remote "origin"]url = git@github.com:orgName/myProject.gitfetch = +refs/tags/v1.0-release:refs/tags/v1.0-release
[branch "some_master"]remote = originmerge = refs/heads/some_master

从branch "some_master"看来,那个 分支的指向应该是没有问题的。但是看看 remote "origin" 好像有问题。

fetch = +refs/tags/v1.0-release:refs/tags/v1.0-release

应该是指向了某个tag,这个tag应该是不能获取到其他分支信息的。于是,使用下面命令

> git fetch -a # 获取所有分支信息

>git branch -a # 展示所有分支信息

更新分支信息后,结果和之前的一样。

* some_master
(END)

说明确实是 origin 指向错误。那就找到了

解决办法

把 .git/config 中的 remote "origin" 的 fetch 改成 +refs/heads/*:refs/remotes/origin/* ,如:

[core]repositoryformatversion = 0filemode = falsebare = falselogallrefupdates = trueignorecase = true
[remote "origin"]url = git@github.com:orgName/myProject.gitfetch = +refs/heads/*:refs/remotes/origin/*
[branch "go_eventer_master"]remote = originmerge = refs/heads/some_master

再去 git pull 没有问题了。

git pull 出现 from the remote, but no such ref was fetched 已解决相关推荐

  1. git pull时提示错误:warning: ignoring broken ref refs/remotes/origin/HEAD的解决办法

    git pull时提示错误:warning: ignoring broken ref refs/remotes/origin/HEAD的解决办法 我用的是IDEA开发的GIT项目,首先找到你项目的根目 ...

  2. Your configuration specifies to merge with the ref from the remote, but no such ref was fetched

    Your configuration specifies to merge with the ref from the remote, but no such ref was fetched 今天使用 ...

  3. git pull报错:Your configuration specifies to...from the remote, but no such ref was fetched

    git branch -a 查看远程该分支是否存在 git fetch -p 拉取最新远程分支 git pull 获取该分支远程代码 注意:记得仔细核对分支名

  4. [WARNING] No archetype found in remote catalog. Defaulting to internal catalog(已解决)

    前言: 遇到问题后,首先,在网络上查找答案.结果告诉我,让我重启IDEA,可是我使用的是CMD命令行,根本没有使用IDEA.或者,告诉我如何操作,却没有解释问题发生的根本原因.于是,我只能去查阅相关文 ...

  5. Git使用:在Git pull时遇到的Error及解决方法

    1. Error: fatal: The remote end hung up unexpectedly error: RPC failed; curl 18 transfer closed with ...

  6. 在什么情况下,“ git pull”会有害吗?

    本文翻译自:In what cases could `git pull` be harmful? I have a colleague who claims that git pull is harm ...

  7. No archetype found in remote catalog. Defaulting to internal catalog 原因 与 解决

    No archetype found in remote catalog. Defaulting to internal catalog 翻译:在远程目录中找不到原型, 默认为内部目录 产生原因 我在 ...

  8. linux下,每次git pull 或者git push都需要输入账号密码的问题以及git remote 的一些基本操作

    一.背景 这个问题以前并没有出现过,最近才出现.对比了下,发现以前连接远程仓库用的是git remote加远程仓库url 连接的.而这次试用git clone直接下载的码云上面的,所以才会出现这种差异 ...

  9. git init、git status、git config user.name、git add、git commit、git remote、git push、git clone、git pull

    1. Git本地仓库初始化 1.1 git init 功能 git init:初始化一个新本地仓库,它会在工作目录下生成一个.git的隐藏文件夹来管理仓库,千万不要删掉它. 1.2 git statu ...

最新文章

  1. 世界五百强世硕科技工作经历——05
  2. oracle 越南字符,ORACLE 12.2RAC之问题 ora.chad OFFLINE
  3. 200905阶段一C++链表与继承特性
  4. Linux 命令之 chown -- 用来变更文件或目录的拥有者或所属群组
  5. Struts2原理图
  6. __init__.py的作用是什么?
  7. Javascript 日期校验完备全过程
  8. GridView中的超级链接
  9. Lwip协议netif结构体详解
  10. 计算机毕业论文附录的模板,毕业论文附录格式要求
  11. 解决:启动springboot项目,Unable to start web server; nested exception is org.springframework.beans.factory
  12. python动画精灵_Python小课堂第18课:如何使用Pygame做动画精灵和碰撞检测
  13. natapp实现内网穿透(详解)
  14. linux安装mysql8.11_Ubuntu安装MySQL任意版本(18.04亲测)
  15. uniapp使用ui库
  16. 数论 · 中国剩余定理(CRT)
  17. div.html attach html,attach.html
  18. Vue3后台管理系统(四)SVG图标
  19. Python:【让繁琐工作自动化】学习笔记
  20. 通过移动设备行为数据预测使用者的性别和年龄

热门文章

  1. LSD(Line Segment Detector)直线提取算法
  2. 如何下载Twitter 数据副本?
  3. 如何科学地蹭热点:用python爬虫获取热门微博评论并进行情感分析
  4. 设有 4道作业,它们的提交时间及执行时间如下,试计算在单道程序环境下,采用先来先服务调度算法和短作业优先调度算法时的平均周转时间和平均带权周转时间,并指出它们的调度顺序。
  5. win10安装visio2010出错_为何我安装Visio 2010时会安装不上,提示下面的错误
  6. 计算机视觉-棋盘格标定
  7. jquery中ajax中的参数,jquery中的ajax参数
  8. 查询计算机系教师开设的所有课程的课程号和课程名
  9. NOI2019滚粗记
  10. Android图片选取和剪裁头像的相关问题