首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >git拉取失败"unable to resolve reference“"unable to update local ref”

git拉取失败"unable to resolve reference“"unable to update local ref”
EN

Stack Overflow用户
提问于 2010-06-08 23:34:41
回答 26查看 528.7K关注 0票数 736

使用git 1.6.4.2,当我尝试一个git pull时,我得到了这个错误:

代码语言:javascript
运行
复制
error: unable to resolve reference refs/remotes/origin/LT558-optimize-sql: No such file or directory
From git+ssh://remoteserver/~/misk5
 ! [new branch]      LT558-optimize-sql -> origin/LT558-optimize-sql  (unable to update local ref)
error: unable to resolve reference refs/remotes/origin/split-css: No such file or directory
 ! [new branch]      split-css  -> origin/split-css  (unable to update local ref)

我试过git remote prune origin,但没有用。

EN

Stack Overflow用户

发布于 2017-05-11 06:11:31

git fetch --prune为我修复了这个错误:

代码语言:javascript
运行
复制
[marc.zych@marc-desktop] - [~/code/driving] - [Wed May 10, 02:58:25]
[I]> git fetch
error: cannot lock ref 'refs/remotes/origin/user/janek/integration/20170505': 'refs/remotes/origin/user/janek/integration' exists; cannot create 'refs/remotes/origin/user/janek/integration/20170505'
From github.com:zooxco/driving
 ! [new branch]            user/janek/integration/20170505 -> origin/user/janek/integration/20170505  (unable to update local ref)
From github.com:zooxco/driving
[marc.zych@marc-desktop] - [~/code/driving] - [Wed May 10, 02:58:30]
[I]> git fetch --prune
 - [deleted]               (none)     -> origin/user/janek/integration

但是,这假设在远程服务器上删除了违规分支。

您还可以将其添加到~/.gitconfig,以便在运行git fetch时自动修剪

代码语言:javascript
运行
复制
[fetch]
    prune = true
票数 31
EN
查看全部 26 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/2998832

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档