How to remove branch from a remote (on Atlassian Stash/Bitbucket)

Praveen picture Praveen · Oct 14, 2013 · Viewed 37.8k times · Source

I want to delete a branch from Atlassian Stash (a sort of github clone) in order to revert my changes. Please let me know what command will do this?

What I know is git branch –D prod-652 deletes the branch from local. How can I delete it from Atlassian Stash?

Answer

Praveen picture Praveen · Oct 14, 2013

Here are the commands:

git branch –D branch-name (delete from local)
git push origin :branch-name (delete from stash)

Note the colon (:) in the last command.