The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Generate Report on Feature Branches Use or Not Being Used

Socko-71
Contributor
May 13, 2020

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Mikael Sandberg
Community Champion
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.

Socko-71
Contributor
June 10, 2021

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

TAGS
AUG Leaders

Atlassian Community Events