Create
cancel
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

Generate Report on Feature Branches Use or Not Being Used

We have an issue with groups not maintaining their projects or repos and removing old and unused feature branches. Is there a report that can be generated that shows last access or commits on all projects, repos, and/or branches. Is there an add-on to do such a thing.

1 answer

1 vote
Mikael Sandberg Community Leader May 13, 2020

One option is to use regular Git commands to list branches and the last commit date for each branch. This command should do that for you:

for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch;done | sort -r

The only app that I know that you can use to get similar information is Awesome Graphs, if there is no report that does it you can always export the raw data and generate a report from it.

Is there a way to script this so I don't have to go through each repo and run this?  I mean like a loop that goes through each project, then each repo of the project and then this query

Mikael Sandberg Community Leader Jun 10, 2021

You could use the REST API to get the projects and corresponding repos, but you would have to clone each one and then run the Git command on the clone. 

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...

3,741 views 10 16
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