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

How to get size of the repository including its Large File Storage?

Nagaraja July 9, 2024

 

 

 

3 answers

3 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 10, 2024

Hi @Nagaraja,

If you are an admin of the repo, you can find this on Bitbucket Cloud website.

  1. Open the repository on Bitbucket's website
  2. Select Repository settings from the left sidebar

The page that opens with the Repository details has info on the Size (size of the core .git repo) and also Git Large File Storage (size of LFS files).

Please be mindful that if you use Git commands to find the LFS size locally, this may not always correspond to the actual value of Git LFS size on Bitbucket. For example, if you rewrite history in the repo to remove some LFS files, this will only affect the pointers in the core repository, LFS files will not be deleted. In this case, the LFS files stored in the repo will be more than what your clone will fetch locally.

The most reliable way to get the size is via the Repository settings page.

Please feel free to reach out if you have any questions!

Kind regards,
Theodora

1 vote
Kuğbe July 9, 2024
Nagaraja July 9, 2024

Hello Kugbe,

Is it possible to get repository LFS file size using repository URL in Rest API call?.

Kuğbe July 9, 2024

Yes, while the Bitbucket REST API does not provide direct LFS size details, you can use the general repository API call for overall repository size and local Git commands to get specific LFS file sizes.

These DOC could help:

https://support.atlassian.com/bitbucket-cloud/docs/use-git-lfs-with-bitbucket/

Nagaraja July 9, 2024

I would be grateful if you could impart the API endpoint and the necessary Git commands to me.

Kuğbe July 9, 2024

for better outlook this DOC can also help: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-group-repositories

This should help:

curl -u username:api_token https://api.bitbucket.org/2.0/repositories/username/repo_slug?fields=size


- This will get you started, but it is a process that will lead to cloning the repo, looking through the repo..., find all files needed and their sizes and including creating a script to sum up all LFS file and file sizes.

This command will help you list all files and their sizes:

git lfs ls-files 

Hope that helps, good luck! (:

Nagaraja July 14, 2024

I need to check the repository size and LFS file size before cloning the repository.

0 votes
Nagaraja July 14, 2024

.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events