git pull错误:错误:远程ref在但预期
完整信息:
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)
  如果你在不区分大小写的文件系统(Windows或OS X)下运行git,如果有两个名称相同但大小写不同的分支,例如user_model_changes和User_model_changes ,两个远程分支将匹配相同跟踪参考。 
  删除错误的远程分支(你不应该只有大小写不同的分支),然后git remote prune origin ,一切都应该工作 
永久修复
  git update-ref -d解决了这个错误的实例,例如 
git update-ref -d refs/remotes/origin/user
请注意,这不会影响远程。
  在我的情况下,随后的git fetch会再次获取该分支,并且随后的git fetches / pull不再给出“remote ref is at but expected”的错误。 
如果这不起作用,临时修复:
  还要注意,如果你不关心有问题的分支(例如,你只是想更新master,而不是origin / user),那么git pull解决方法是获取然后合并你关心的特定分支,例如 
git fetch # may give an error for a particular branch, but other branches will still be successfully fetched
git merge origin/master
只需删除“.git refs remotes origin”下的文件夹和文件即可。 当你没有任何改变时工作
链接地址: http://www.djcxy.com/p/26095.html