Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage
  • Community
  • Products
  • Bitbucket
  • Questions
  • How do I delete a branch that was created after using the Bitbucket edit/create pull request function (delete branch option is greyed out)?

How do I delete a branch that was created after using the Bitbucket edit/create pull request function (delete branch option is greyed out)?

We have a branch in a git repo on our Bitbucket that we are unable to delete ("Delete branch" option under the gear icon is greyed out). Not sure if this is specific to what we did to create it but I'd like to figure out how we can delete it.

The branch originally got created by using the Bitbucket online editor, then committing and checking the "create pull request from commit" option. We then tested by declining the pull request.

Shouldn't we be able to still delete this branch? If so, how? (git commands for doing this would be acceptable, I'm still fairly new to git and none of the branch deletion commands I've tried have worked but it's possible I'm doing them wrong).

Thanks!

2 answers

1 accepted

0 votes
Answer accepted

Hi Jesse,

Thanks, I found that I needed to use a slightly different command:

git push origin :<branchName>

Not sure if that's due to a difference in versions of git, but it did work.

Thanks for your help!

-steve

This command does not delete a branch and ti is the wrong command syntax.  I have no idea why it was accepted.  The command below from @Tabrej Shekh is correct.

Can we delete a branch from the bitbucket web application without running the command.

0 votes
jyo Atlassian Team Aug 06, 2013

Hi Steve,

You will want to use the following to delete a remote branch:

git push --origin delete <branchName>

Make sure you have the correct branch permissions set under the 'Branch management' admin menu (click on the 'gear' icon) but if this does not work, tell us, and we can look in your remote git config to make sure you don't have any flags that are preventing you from deleting a branch.

Cheers,

Jesse

git push origin --delete <branchName>

Like # people like this

This is the correct command.  At least, it is what I use and it works git version 2.21.1 (Apple Git-122.3).  I unfortunately have had to use it several times in the last few days.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

524 views 4 13
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you