Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
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

Is there a query or plugin that will create an audit report of feature branches in Bitbucket Server?

Our developers have a bad habit of not deleting the branches after they merge into develop or a release. So trying to figure away to check either last time accessed or just date created so we can notify them of old branches that needed deleted.

1 answer

1 accepted

0 votes
Answer accepted

Great question/request. There are a few ways to achieve this.

1. When a PR is merged Bitbucket Server offers to delete the source branch after the merge.

pr merge.png

2. Add an existing hook by clicking 'Add Hook' in your repo settings [1] and find a suitable hook on the Atlassian Marketplace

3. Write your own PostReceiveHook (called after merge) [2]

Let me know if you need any further guidance. We at Izymes have made an add-on that takes care of shaping your development and merge process from start to finish - it's called Workzone. Among a lot of other things can take care of deleting the source branch after merge. You can configure that on a branch-by-branch basis, you don't want to delete `develop` when it is merged to `release` for example :-)


[1] Documentation

[2] Developer documentation 

I can see how this relates to your previous question.

The repository owner may choose to implement a policy (see above) to delete merged branches right after they have been merged. As this only happens on the server, but not on the developers' machine, developers can still maintain a local branch, if they choose to. Then it is the developers' responsibility to declutter local branches that have been merged, but not yours.

As my father used to say: "Trust is good, control is better." LOL

Fantastic answer plus you actually provided how-to's wish they graded these answers like a 1 to 5, I'd give this one a 10!!

Suggest an answer

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

📣 Calling Bitbucket Data Center customers to participate in research

Hi everyone, Are you Bitbucket DC customer? If so, we'd love to talk to you! Our team wants to dive deep to understand your long-term plans regarding Bitbucket DC and Atlassian Cloud. Do you plan...

184 views 2 4
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