完整的信息:

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

其他回答

请按照如下顺序执行以下命令

git gc --prune=now
git remote prune origin
git pull

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

清晰的步骤

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

希望它现在有用。

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

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

然后手动操作:

git pull [remote_name] [branch_name]

我找到了改动的地方。

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

我运行这个来解决问题:

git gc --prune=now