Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,297,996
Community Members
 
Community Events
165
Community Groups

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

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,222 views 2 9
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