refs/remotes/origin/feature/US12376 分支被推送到 origin 但在它询问之前的时间:

Your branch is based on 'origin/feature/US12376', but the upstream is gone.
  (use "git branch --unset-upstream" to fixup)

所以我使用了git branch --unset-upstream(成功通过)。

继续在里面工作

提交后,我尝试 git push --set-upstream origin feature/US12376 但出现错误:
error: update_ref failed for ref 'refs/remotes/origin/feature/US12376': cannot lock ref 'refs/remotes/origin/feature/US12376': 'refs/remotes/origin/feature/US12376/patchFix' exists; cannot create 'refs/remotes/origin/feature/US12376'

远程分支 refs/remotes/origin/feature/US12376/patchFix 已删除。

最佳答案

本地 git 存储库仍然引用 refs/remotes/origin/feature/US12376/patchFix ,即使它已被远程删除。

要删除这些引用,您可以运行

git remote prune origin

关于Git push --set-upstream 问题,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/45981187/

10-13 08:50