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

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Converting repository to use LFS with BFG Edited

I've been trying to convert a repository that we currently have to use LFS to store large blob files. I found an article here: but this article does not seems to work entirely. I did step A, which did not seem to change anything (even though it shows an uploading prompt at the git bash terminal). Step B seems to move the files in HEAD to LFS storage, but after I'm done with this step I still have ~500mb of blob files in my git history that have not been updated.

After this I attempted to follow the instructions given by the support article at the BFG creator's repository (, and while the 

git reflog expire --expire=now --all && git gc --prune=now

command seems to move these historical large blobs into LFS storage, it does not prune them from my git history and my repo size remains very large. After using these steps my LFS storage has the appropriate size, but the repo size remains the same and is now about the same size as the LFS files.

The instructions given on the Atlassian support page are vague to say the least. In the article shown at I have several questions:

- In step A3 should I be running this command from outside of the <repo-name>.git folder?
- After step A3 why am I not told to run 

git reflog expire --expire=now --all && git gc --prune=now

to clean the history of the git repository with references to LFS where these large files existed in the history?

- After step A5 I am assuming that I should `cd ..` to get out of the <name>.git folder and clone the repository normally with 

git clone<username>/<repo-name>.git

before setting up LFS locally using the instructions linked in step B2.

- After all of this I've gathered (from BFG documentation) that these large files still exist in my main git repository code but only in the HEAD commit. I assume that B2 is to change that for the HEAD of my repository (on master), which it seems like it did. None of these steps, however, have removed large blob files from my git history as it was advertised. It seems that these files have just been copied to an LFS store while they still remain clogging up the Git repo. Is there any way to migrate these historical blobs to LFS storage? We have a repository that is currently ~1.6GB in size that we need to reduce as soon as possible.

0 answers

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

1,922 views 0 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you