完整的信息:

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)

当前回答

我知道这很旧了,但我有自己的办法。因为我使用的是源树,这个错误发生是因为有人创建了一个新的分支。源树对此感到困惑。在我按下“remote branch to pull”组合框旁边的“Refresh”按钮后,似乎sourcetree已经更新了分支列表,现在我可以成功拉起。

其他回答

试试这个,对我很管用。 在您的终端:git远程修剪原点。

Git for-each-ref——format='delete %(refname)' refs/original | Git update-ref——stdin Git reflog expire—expire=now—all Git gc -prune=现在

我必须从命令行中删除我的分支:

.git\refs\remotes\{my remote}\{**my branch**}

然后手动操作:

git pull [remote_name] [branch_name]

我找到了改动的地方。

注意:我正在使用SourceTree,无法进行拉取。

经过不断的搜索,这是对我有效的解决方案,需要清除/移除上游

git branch --unset-upstream

清晰的步骤

在终端 cd / . / /遥控器/参考文献来源 做ls,你会看到一些树枝和头部 移除你认为有问题的分支 rm branchname 如果它不起作用,删除所有分支/HEAD 你可能想拉一把

希望它现在有用。