Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Socko-71
Contributor
June 10, 2021

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
Ulrich Kuhnhardt _IzymesCo_
Atlassian Partner
June 10, 2021

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 

Ulrich Kuhnhardt _IzymesCo_
Atlassian Partner
June 10, 2021

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

Socko-71
Contributor
June 11, 2021

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
TAGS
AUG Leaders

Atlassian Community Events