git pull fails “unable to resolve reference” “unable to update local ref”
问题
由于有人rebase了分支,或者不知道怎么搞的。其他人拉取代码的时候,发现拉不下来。
>git fetch
error: cannot lock ref 'refs/remotes/origin/xxx-branch': is at 8117caf7b1c88b2d5dfebd7581f6891d87b9abee but expected f38e8d35ae8ea7f177c537a98f4140dd76b8e2bd
From xxxxxxx-git-url
! f38e8d35..9d7b8e7a xxx-branch -> origin/xxx-branch (unable to update local ref)
解决方案
尝试clean本地git
$ git gc --prune=now
$ git remote prune origin
man git-gc(1):
git-gc - Cleanup unnecessary files and optimize the local repository
git gc [--aggressive] [--auto] [--quiet] [--prune= | --no-prune]
Runs a number of housekeeping tasks within the current >repository, such as compressing file revisions
(to reduce disk space and increase performance) and removing unreachable objects which may have been
created from prior invocations of git add. Users are encouraged to run this task on a regular basis within each repository to maintain good disk
space utilization and good operating performance.
man git-remote(1):
git-remote - manage set of tracked repositories
git remote prune [-n | --dry-run]
Deletes all stale remote-tracking branches under <name>. These stale branches have already been
removed from the remote repository referenced by <name>, but are still locally available in
"remotes/<name>".
来源
Stack Overflow ,
原问题:https://stackoverflow.com/questions/2998832/git-pull-fails-unable-to-resolve-reference-unable-to-update-local-ref
git pull fails “unable to resolve reference” “unable to update local ref”的更多相关文章
- error: cannot lock ref 'refs/remotes/origin/master': unable to resolve reference 'refs/remotes/origin/master': reference broken...
之前在自己的项目中添加了一个分支,然后做了一些操作,比如同步本地的分支情况到远程仓库中,然后在远程仓库中完成分支合并,以及 Pull request 等等操作,后来,在本地仓库中进行 git fetc ...
- git pull报“unable to update local ref”解决方案
使用git pull拉取代码的时候,无法拉取最新代码,报"unable to update local ref"错误. 除了重新clone一份代码外,还可以使用如下解决方案: 1. ...
- git pull时 git cannot lock ref XXXXXX (unable to update local ref)错误解决方案
git pull : git cannot lock ref XXXXXX (unable to update local ref) pull代码的时候出现的错误,导致代码拉不下来. 看了一下 ...
- 使用git pull拉取代码的时候,无法拉取最新代码,报"unable to update local ref"错误。
使用git pull拉取代码的时候,无法拉取最新代码,报"unable to update local ref"错误. 除了重新clone一份代码外,还可以使用如下解决方案: .切 ...
- git (unable to update local ref )
https://stackoverflow.com/questions/2998832/git-pull-fails-unable-to-resolve-reference-unable-to-upd ...
- 项目记事【Git】:git pull 出错 error: cannot lock ref 'refs/remotes/origin/feature/hy78861': is at d4244546c8cc3827491cc82878a23c708fd0401d but expected a6a00bf2e92620d0e06790122bab5aeee01079bf
今天 pull 代码的时候碰到以下问题(隐去了一些公司敏感信息): XXX@CN-00012645 MINGW64 /c/Gerrard/Workspace/XXX (master) $ git pu ...
- git pull时出现unable to unlink old 一个不该犯下的错误
在日常开发中,当团队内有人将新的代码打成jar文件提交,并且未改名的时候,可能会出现这样的错误"error: unable to unlink old 'Test/lib/xxx-1.0.0 ...
- Unable to resolve target 'android-XX'解决办法
在搭建好安卓编译环境后,我用Eclipse导入冲git上下载的安卓源码编译时,会提示 Unable to resolve target 'android-17' 等 “Unable to resolv ...
- git clone时,提示warning: remote HEAD refers to nonexistent ref, unable to checkout
一.环境 发行版:Ubuntu 18.04.1 LTS 代号:bionic 内核版本:4.15.0-30-generic 二.背景 git clone https://source.codeauror ...
随机推荐
- MikroTik RouterOS安装到SATA硬盘
其实这个问题再5.x以上的版本就已经不存在这个问题,基本现在的版本都支持SATA,如果不支持,估计用的是2.x版本的,那么只需要设置成混合模式(百度)即可.
- How Visual Studio 2012 Avoids Prompts for Source
[原文地址]:http://blogs.msdn.com/b/heaths/archive/2012/07/26/how-visual-studio-2012-avoids-prompts-for-s ...
- oracle HA 高可用性具体解释(之二,深入解析TAF,以及HA框架)
oracle HA 高可用性具体解释(之中的一个,client.server端服务具体解释):http://write.blog.csdn.net/postedit 我们已经看到TAF是的Oracle ...
- Revit Family API 添加类型
FamilyManager.NewType("");添加新类型,然后设置参数,就是为新类型设置参数. [TransactionAttribute(Autodesk.Revit.At ...
- 玩DNF开启NVIDIA独显的方法
管理员身份运行后,点下红圈圈里的X,打开驱动配置文件,在Profiles里输入DNF,打开配置文件 把do not display this profile in the control panel ...
- Android 开机画面和wallpaper总结
Android 开机画面和wallpaper总结 1 kernel的开机画面修改 1.图片需求:图片格式:png图片大小:1024x600(具体示lcd分辨率而定). 2.转换图片png图片. 假设 ...
- ASP.NET MVC:模块化/插件式文章汇总
方案 Shazwazza | Developing a plugin framework in ASP.NET MVC with medium trust 基于ASP.NET MVC3 Razor的模 ...
- dwz 分页 bug (选回 combox 第一个值时不执行 onchange)
先看一下官方的测试: 官方的演示有两个 bug 一个是combox数字一直不变,二是当选回第一个值时不执行 onchange 事件. 经过firebug调试,这是一个bug,传到后台的参数没有得到及时 ...
- ios之单例模式
原帖地址:http://www.galloway.me.uk/tutorials/singleton-classes/ 本文为博主自行翻译,转载请注明出处:http://blog.csdn.net/i ...
- PHPthinking赠书了!
[站长赠书]2014年10月第一期幸运用户 大家好,我是PHP开发学习门户的站长,小站建站一个多月,感谢大家以来的关注和支持,假设大家对本站有什么建议或者投稿,欢迎留言或者给我发邮件. 本站宣布对于 ...