完整的信息:

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)

当前回答

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

其他回答

我运行这个来解决问题:

git gc --prune=now

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\origin下的文件夹和文件。 工作,当你没有未推送的更改。

硬重启也会解决这个问题

git reset --hard origin/master

依次使用下面两个命令。

git gc --prune=now

git remote prune origin

这将解决你的问题。