Git push --set-upstream 问题

Git push --set-upstream issue

分支 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