How to list out the branches which are older than 30 days old in bitbucket
Issue #57
closed
I want clean the bugfix branches which are older than 30 days , is there any plugin or code snippet for doing this in bitbucket ?
Could you please suggest me how to proceed this ?
BR
Ashok G
Comments (2)
-
repo owner -
repo owner - changed status to closed
- Log in to comment
The "branches" page for each repository in Bitbucket has enough information to extract the names of all old branches, and the branches are sorted on that page by "committerDate" (even though that page shows dates based on "authorDate"!). Unfortunately there's now way to reverse the sort so that older branches come first, and so doing things this way could require a lot of clicking.
If you're comfortable with git command-line, try these two commands in sequence:
You could combine the commands above with xargs to do some interesting things. More information on this Atlassian Community page: Is there a way to delete branches in bulk?
p.s. To better understand the difference between committerDate and authorDate, this is a useful command: "git log --pretty=fuller".