Naively, I thought that git push origin origin/branchname, which was suggested by tab completion, would do the same as git push origin branchname. However, it created a new remote branch named "origin/branchname". I want to delete this branch while keeping the remote branch named "branchname" on orign.
I tried git push -d origin origin/branchname and git push -d origin remotes/origin/branchname. But both do not exist. Note that I can not use git push -d origin branchname since this would delete the remote branch named branchname and not the remote branch named "origin/branchname".
>Solution :
Use the delete parameter after origin.
This will delete the branch named origin/branchname but leave branchname intact.
git push origin --delete origin/branchname