Bitbucket Import existing code using import wizard is omitting LFS files
Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.
Summary
The web repository importer in Bitbucket does not support importing Git LFS files. However, one way to workaround this would be to push the LFS files using the command line instead.
Cause
The requested feature to move LFS files is not available as the LFS files are stored in different storage and have to be manually imported as a workaround.
Solution
Since the LFS files are not migrated using the repo import tool. Hence you would need to re-push the LFS files to the repository by following the below steps:
First, please check if git LFS is installed on your system locally by executing the command:
1
git lfs --version

If not present, kindly install git LFS as instructed in the reference.
Reference: https://git-lfs.github.com/
Next steps:
Create a mirror clone of the source repo containing the LFS files by running the below command:
Source repo containing the LFS files 24.86MB of storage:

1
git clone --mirror <bitbucket repo url>
Changing into the repo:
1
cd repoName
Get all the LFS files from the source repo:
1
git lfs fetch --all origin

Targeted repo, no LFS files present at the moment and 0B used:

Add the targeted repo (where you would like to push the LFS files to) as a remote:
1
git remote add <your_remote_name> <bitbucket repo url>

Next, please verify if the new remote was properly added:
1
git remote -v

And finally, push the LFS files to the targeted repo:
1
git lfs push --all <your_remote_name>

Conclusion: On the targeted "getme" repo, we can see that the LFS files were successfully pushed.


Was this helpful?