Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why did remote origin delete failed? remote ref does not exist

Tags:

git

I tried

 git push origin --delete remotes/origin/featgmodel
error: unable to delete 'remotes/origin/featgmodel': remote ref does not exist

But git branch -a show that it exists

* main
  remotes/origin/HEAD -> origin/main
  remotes/origin/featgmodel

if I try

git push -d remotes/origin/featgmodel

got

fatal: --delete doesn't make sense without any refs

How to delete remote branch?

like image 695
MJoao Avatar asked May 30 '26 05:05

MJoao


1 Answers

The expected syntax is git push --delete origin featgmodel

See doc for git push

git push [...] [-d | --delete] [...] [<repository> [<refspec>…​]]

remotes/origin/featgmodel is where your remote-tracking branch is stored, not the name of the remote branch.

like image 167
Romain Valeri Avatar answered Jun 02 '26 19:06

Romain Valeri



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!