完整的信息:

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)

当前回答

我遇到过这个问题,我的解决方案如下:

步骤1:

请先执行该命令。 git gc—Prune=现在

步骤2:

如果运行步骤1命令后没有错误,则在终端中运行下面的命令。 git远程删除源文件

我希望这能解决你的问题。

其他回答

只需删除\.git\refs\remotes\origin下的文件夹和文件。 工作,当你没有未推送的更改。

我也遇到了同样的问题,我只是删除了远程分支,并从master中创建了新的分支,并将我从旧功能分支到新功能分支的更改合并在一起。现在我尝试了拉和推的要求,它为我工作

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

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

git branch --unset-upstream

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

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

然后手动操作:

git pull [remote_name] [branch_name]

我找到了改动的地方。

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