Delete a remote branch with the same name as tag

You can push the full branch refspec:

git push origin :refs/heads/3.0.0
# shorter:
git push origin :heads/3.0.0

That would reference only a branch, not a tag (refs/tags/3.0.0).

Here the refspec has no source in front of the ‘:‘: that means HEAD.
:refs/heads/3.0.0 is HEAD:refs/heads/3.0.0.
That means you need to checkout the correct branch before pushing.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)