git pull 错误 :error: remote ref is at but expected

标签 git pull git-pull

完整消息:

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_changesUser_model_changes 作为两个远程分支将匹配相同的跟踪引用。

删除错误的远程分支(你不应该只有大小写不同的分支)然后 git remote prune origin 一切都应该工作

关于git pull 错误 :error: remote ref is at but expected,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11796580/

相关文章:

git - 为什么 git 没有 'git ignore' 命令?

Git 无法识别别名

image - Docker:无法从损坏的拉取中删除中间图像

git - 如何防止从与当前分支不同的地方 pull 入 git

Git pull 依赖于当前目录

git - 'git pull' 和 'git fetch' 有什么区别?

git - 如何获取所有远程分支, "git fetch --all"不起作用

git - 如何暂时忽略 git pull 上未跟踪的文件?

git - 你让我 pull 而没有告诉我你想 merge 到哪个分支

git - 如何分别跟踪主配置文件和远程配置文件?