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

40,117

Solution 1

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.

Solution 2

In Stash (2.10), go to the Branches view. You can select Delete from the Actions button

Solution 3

Branches view -> Delete(select from options)

enter image description here

Solution 4

If you have installed Atlassian SourceTree (Windows/Mac only) on your client machine you can do it from there by right clicking on the remote branch and choosing delete. (Under the hood it does the same commands as Praveen's answer)

Share:
40,117
Praveen
Author by

Praveen

Web Developer (HTML)

Updated on December 06, 2020

Comments

  • Praveen
    Praveen over 3 years

    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?