29

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?

lifeisfoo
  • 15,478
  • 6
  • 74
  • 115
Praveen
  • 1,772
  • 3
  • 24
  • 42
  • 6
    The unfortunately-named Atlassian Stash is a proprietary Git code hosting solution. I'm not sure who though this name was a good idea. (The name is indicative of the many other issues the app has.) – George Hilliard Oct 15 '13 at 07:45

4 Answers4

40

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.

Jess
  • 23,901
  • 21
  • 124
  • 145
Praveen
  • 1,772
  • 3
  • 24
  • 42
  • `git push origin` has nothing to do with what git calls a "stash", but rather with what git calls a "remote". So it sounds like your question was actually about deleting a branch on a "remote". See [How do I delete a git branch both locally and remote?](http://stackoverflow.com/q/2003505/1256452). – torek Oct 14 '13 at 16:20
  • 6
    As per the comments above, I believe the question is about the Atlassian product 'Stash' which is a Git hosting solution. The question should probably be renamed to "How to remove branch from a remote (on Atlassian Stash)" – Lee Campbell Jan 29 '14 at 12:30
  • 2
    In the UI the option appeared in 2.1 for merged branches and in 2.8 in general: https://jira.atlassian.com/browse/STASH-3347 and https://jira.atlassian.com/browse/STASH-2753 – LAFK 4Monica_banAI_modStrike Feb 18 '14 at 18:28
24

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

wreckgar23
  • 1,025
  • 9
  • 22
16

Branches view -> Delete(select from options)

enter image description here

Moumit
  • 8,314
  • 9
  • 55
  • 59
5

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)

Community
  • 1
  • 1
danio
  • 8,548
  • 6
  • 47
  • 55