完整消息:
error: Ref refs/remotes/origin/user is at 3636498c2ea7735fdcedc9af5ab3c8689e6abe77 but expected a21359c6cc2097c85775cde6a40105f4bd7100ec
From github.com:{github project url}
! a21359c..6273ffc user -> origin/user (unable to update local ref)
发布于 2012-08-22 17:15:48
如果你在一个不区分大小写的文件系统(Windows或OS X)下运行git,如果有两个分支同名但大小写不同,例如user_model_changes
和User_model_changes
,就会发生这种情况,因为两个远程分支都会匹配相同的跟踪引用。
删除错误的远程分支(不应该只有大小写不同的分支),然后使用git remote prune origin
,一切都应该正常工作
发布于 2014-12-30 03:21:40
永久修复
git update-ref -d
解决了此错误的实例,例如
git update-ref -d refs/remotes/origin/user
请注意,这不会影响远程。
在我的例子中,后续的git fetch
再次获取了该分支,并且随后的git获取/提取不再给出错误"remote ref is at at“。
如果这不起作用,一个临时解决方案:
还请注意,如果您不关心有问题的分支(例如,您只想更新主分支,而不是源/用户),则git pull
解决方案是获取然后合并您关心的特定分支,例如
git fetch # may give an error for a particular branch, but other branches will still be successfully fetched
git merge origin/master
发布于 2016-03-15 19:59:21
只要删除\.git\refs\remotes\origin
下的文件夹和文件即可。当你没有未推送的更改时,它会起作用。
https://stackoverflow.com/questions/11796580
复制相似问题