完整的信息:

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 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远程修剪原点。

依次使用下面两个命令。

git gc --prune=now

git remote prune origin

这将解决你的问题。

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

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

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

然后手动操作:

git pull [remote_name] [branch_name]

我找到了改动的地方。

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