Serhii
Serhii

Reputation: 7543

Git push --set-upstream issue

the branch refs/remotes/origin/feature/US12376 was pushed to origin but times before it asked:

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

so I used git branch --unset-upstream (passed successfully).

Continue working in it

After commit I try git push --set-upstream origin feature/US12376 but got error:

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'

remote branch refs/remotes/origin/feature/US12376/patchFix was deleted.

Upvotes: 4

Views: 1209

Answers (1)

crea1
crea1

Reputation: 12557

Local git repository still has a reference to refs/remotes/origin/feature/US12376/patchFix, even though it has been deleted remotely.

To remove those references you can run

git remote prune origin 

Upvotes: 5

Related Questions