How to check if Git-LFS is being used on Bitbucket Server side

Viewed 1438

I'm using Git-LFS to manage some large files in a Git repository. I'm pretty certain that I have configured things correctly locally, because I can do git lfs track to see the tracked patterns, etc. The remote for my repo is a Bitbucket Server instance, and I'm less certain however that I've configured everything correctly there.

So, is there a way of seeing on the Bitbucket Server repository that the large files there are indeed being managed by Git-LFS? Either some command I can run, pointing it to the remote, that lists all the files under Git-LFS, or some Git-LFS status page in the GUI. Thanks!

2 Answers

In general in the repository settings ( Repository settings > Large file storage (LFS) ) there is only a checkbox to tick the "Allow LFS" option. But this just says, the repo is ready to use LFS for large files, it does not mean yet, you have already some file stored by LFS means.

You can try these two commands: git lfs track ( without further parameter). This reports which file extensions are configured for LFS (e.g. *.dll ). But older files in the repository can still be stored inside the repo and newer versions are handled in the LFS storage - from the time on, when you have executed your command git lfs track *.dll. So even if git lfs track returns some information, it can be that there are no LFS files yet.

Better might be the command git lfs ls-files --all. If it does not return anything, I would assume, there are no LFS files yet in this repo. The option --all is important to check the history of the whole repository, otherwise only the current branch will be inspected.

select * from INFORMATION_SCHEMA.TABLES where LOWER(TABLE_NAME) like '%lfs%' lead me to 2 tables:

  • AO_<HEX>_GIT_LFS_LOCK
  • AO_<HEX>_GIT_LFS_REPO_CONFIG

The ...REPO_CONFIG table has the following columns:

  • IS_ENABLED
  • REPOSITORY_ID

The query to find repos using LFS would be something akin to:

select r.id, r.name, r.slug, p.name as project, p.project_key
from repository r
    left join project p on r.project_id = p.id
    inner join AO_811463_GIT_LFS_REPO_CONFIG lfs ON r.id = lfs.REPOSITORY_ID
where lfs.IS_ENABLED = 1
Related