LFS Repo Conversion Issue

Alan Cordner March 15, 2022

I just converted an existing repo to use LFS after I found it had exceeded 2GB in size. I followed the instructions here: https://support.atlassian.com/bitbucket-cloud/docs/use-bfg-to-migrate-a-repo-to-git-lfs/

Everything seemed to go fine, but when I clone the repo now, and install LFS, then restart SourceTree, the files stored in LFS get downloaded to my local repo, but they all show up as changed files that need to be committed and pushed to origin! As a test, I committed only one of the 1200+ files and pushed it to origin. When I checked the commit in Bitbucket, I can see that the previous revision of the file is in LFS, but the new commit puts the file back into the repo where it was previously. I reverted that commit and I can see the file went back to being in LFS, but now my local copy of the file in the file system is 1KB and unreadable (hasn't been downloaded from LFS). Restarting SourceTree causes the file to be downloaded again, and my count of files that need to be sommitted/pushed goes back to the original value.

I do not understand how I got here and what can be done to resolve this. Any suggestions would be appreciated. 

1 answer

1 accepted

0 votes
Answer accepted
Alan Cordner March 16, 2022

It appears the .gitattributes file was missing from my repo, and the config file needed to be manually updated to contain the lines related to LFS. I was able to copy the config file lines from the config file that was generated following the conversion process, and I was able to copy the .gitattributes file from another repo and alter it for the file types that LFS applies to in this repo.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events