Git push --set-upstream问题

时间:2017-08-31 12:12:03

标签: git git-bash

分支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已删除。

1 个答案:

答案 0 :(得分:5)

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

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

git remote prune origin