Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to delete Git LFS files from BitBucket Data Center

Parimal Mehta
May 29, 2025

My company currently uses BitBucket Data Center v9.4.2. My team has a project that is source controlled with a Git repository on BitBucket. 

We are planning to start using Git LFS because we want to source control some larger binary files.

My questions are:

 

  1. In the future, if I need to remove some old Git LFS files from source control, how do I delete Git LFS files from BitBucket Data Center?
  2. One option I read about(Check [2]) - To delete Git LFS objects from a repository, delete and recreate the repository. Is the repository mentioned my Git repository or a separate Git LFS repository?


I have seen some answers, but they are related to either Cloud or Server:

* [1]https://community.atlassian.com/forums/Bitbucket-questions/How-to-delete-old-lfs-files-from-a-fork/qaq-p/2892902
* [2]https://community.atlassian.com/forums/Bitbucket-questions/Delete-Git-LFS-files/qaq-p/863172

Thank you!

1 answer

0 votes
Mehul Chauhan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 4, 2025

For Bitbucket Data Center (including 9.4.2), there are two different things to consider:

  1. Removing LFS files from Git history

    • Use a history‑rewrite tool locally (for example, BFG, git filter-repo, or git filter-branch) to remove the LFS‑tracked files or pointers from the commits.

    • Then force‑push the cleaned history to Bitbucket.

    • This removes the pointers from the repository’s history, but does not delete the underlying LFS objects from Bitbucket’s LFS storage.

  2. Deleting LFS objects from Bitbucket’s storage

    • Bitbucket Data Center’s embedded LFS store doesn’t provide a supported way to delete individual LFS objects for a repo.

    • The only supported way to delete all LFS objects for a repository is to delete the Bitbucket repository itself.

    • When the docs/community answer say “delete and recreate the repository”, they mean your normal Bitbucket Git repository (the one under <project>/<repo> in the UI). Deleting that repo also removes its LFS data from $BITBUCKET_HOME/shared/data/git-lfs/storage.

    • The link for Bitbucket Server is relevant for Bitbucket DC as well.

So in practice:

  • If you want to stop using certain LFS files and keep the repo: rewrite history to remove the pointers; the LFS blobs will still exist on disk.

  • If you need to thoroughly purge LFS data for that repo from Bitbucket: back up, delete the repo in Bitbucket, recreate it, and push a cleaned history without those LFS files.

Interesting related reads:

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events