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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.