Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to get a list of all empty repositories from Bitbucket

Alejandro Carretero Trejo
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 16, 2024

Hi, 

I would like to know if there is some DB query in PostgreSQL to get a list of all empty repositories from Bitbucket instance.

Another option for me will be to get a list of all repositories from Bitbucket instance that only contains README.md and .gitignore files, in other words, repositories that have no files or code at all inside them.

Thanks in advance.

1 answer

1 vote
Neeraj Upadhyay
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 16, 2024

You can use the below query to find all empty repo's

select * from bb_repo_size where total=0

The DB query provides a list of repositories with pre-calculated sizes saved in the DB table `bb_repo_size` table. It might be possible that the repo sie of a specific repo might not be present in the table, in that case, one simple method to prompt Bitbucket to update the size of these missing repositories is to remove the `<BITBUCKET_HOME>/shared/config/upgrades/core-backfill-repo-size` file and restart Bitbucket service. This action triggers the generation of sizes for repositories not already present in the database, ensuring they are updated as expected.

More details in the Kb: https://confluence.atlassian.com/display/BitbucketServerKB/How+to+find+the+size+of+a+repository+hosted+on+Bitbucket+Server+and+Datacenter

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events