Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在尝试git fetch远程分支时遇到以下错误:
错误:Ref refs/origin/remotes/my-branch 处于某个哈希值,但预期另一个哈希值 来自 github.com:my-repository !some-hash my-branch -> origin/my-branch (无法更新本地参考)
我不知道刚才到底炸了什么。有什么启示吗?
有人创建了另一个名称相同但大小写不同的分支。
用于 Windows 的 Git 不区分大小写。所以,事情变得疯狂了!Git 无法区分一个和另一个,误认了每个人的头部的哈希值。
只是从根源上斩断邪恶。删除了错误的远程分支,一切都像以前一样好。
对于其他到达这里的谷歌人:这也是另一种不那么激烈的方法:
导航到.git\refs\remotes\origin目录 - 删除主文件,
.git\refs\remotes\origin
然后再做一次git pull,它同步成功。
git pull