git: error: cannot lock ref, error: cannot lock ref

原创 2018年04月16日 13:48:55

在执行git pull的时候会出现这样的错误:

$ git pull
error: cannot lock ref 'refs/remotes/origin/branch': 'refs/remotes/origin/branch/repair' exists; cannot create 'refs/remotes/origin/branch'
From git.microsoft.com:office2019/excel
 ! [new branch]        branch      -> origin/branch  (unable to update local ref)
error: some local refs could not be updated; try running
 'git remote prune origin' to remove any old, conflicting branches

解决办法就是根据提示执行:

git remote prune origin

我们知道当我们一个branch从push–>open–>approve–>merge,大致都要经过这几个过程,当我们一个branch被merge到master以后,我们就要求会删除github上的branch,但是我们本地的branch却一般没人管,时间长了,本地的branch就会积累一堆,这个命令就是将本地还没有删除的branch一起清除掉。

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/sinat_36246371/article/details/79959598

git pull时遇到error: cannot lock ref 'xxx': ref xxx is at (一个commitID) but expected的解决办法

git pull时遇到error: cannot lock ref ‘xxx’: ref xxx is at (一个commitID) but expected的解决办法在执行git pull时遇到如...
  • qq_15437667
  • qq_15437667
  • 2016-09-09 00:07:23
  • 9725

git pull时遇到git pull error :error: remote ref is at but expected问题的解决办法

今天在拉取项目新版本的代码时,遇到了一个问题,对项目最新的代码进行git pull,报错:error: cannot lock ref 'xxx': ref xxx is at (一个commitID...
  • ShorewB
  • ShorewB
  • 2016-06-01 20:24:13
  • 3003

git push时报错cannot lock ref....

git push的时候报错:remote: error: cannot lock ref ‘refs/heads/develop’: is at 2e57ec93df385ba97723ccc9a36...
  • chenyunxia2017
  • chenyunxia2017
  • 2017-02-14 15:13:10
  • 277

cannot lock ref问题的解决

1. git pull代码出现 cannot lock ref 'refs/remotes/origin/branch_name': is at 95b2ddb09e303b4857d6c0fd654...
  • qq_29781403
  • qq_29781403
  • 2017-11-06 10:30:08
  • 1412

git cannot lock ref

如果在 git 准备下载仓库的时候,出现下面的错误 cannot lock ref ‘refs/remotes/origin/xx’:’refs/remotes/origin/xx/xx’ exis...
  • lindexi_gd
  • lindexi_gd
  • 2018-01-31 09:17:14
  • 385

error: cannot lock ref 'a/b/c/d' exists; cannot create 'a/b/c/d'

在使用git pull的时候出现这样的错误。 解决办法: 首先要删除引用,有多少删除多少: git update-ref -d a/b/c/d 然后在使用: git pull 实在不行...
  • sinat_36246371
  • sinat_36246371
  • 2018-02-06 13:59:23
  • 140

git pull/push: unable to resolve reference & unable to update local ref

git pull/push origin xxx 报错如下 error: cannot lock ref 'refs/remotes/origin/xxx': unable to resolve r...
  • jym_ycc
  • jym_ycc
  • 2017-06-20 11:53:46
  • 1700

Git Push:error: Couldn't set refs/remotes/origin/master;error: update_ref failed for ref 'refs/remot

作者:荒原之梦 原文链接:http://zhaokaifeng.com/?p=543 今天使用Git Push代码时产生错误: Rename from 'XXXX/.git/refs/r...
  • wy_bk
  • wy_bk
  • 2018-02-08 16:11:35
  • 284

git pull error: remote ref is at but expected

AnalysisIf you are running git under a file system that is not case sensitive (Windows or OS X) this...
  • fgszdgbzdb
  • fgszdgbzdb
  • 2017-09-12 08:11:53
  • 226

git 常见报错解决方法

身为一个小白在玩github这样的版本管理工具总是会犯一些低级错误,以下是我记录出现错误时的解决办法的笔记,又出现同样问题的小伙伴可以参考一下!...
  • xiaojian_Bai
  • xiaojian_Bai
  • 2016-12-13 11:14:03
  • 330
收藏助手
不良信息举报
您举报文章:git: error: cannot lock ref, error: cannot lock ref
举报原因:
原因补充:

(最多只允许输入30个字)