I am trying to migrate Bitbucket repositories to DevOps using the import repository function in DevOps. Some of those repositories have LFS enabled, and it looks like DevOps does not import the LFS files since when I clone the repo I got a lot of LFS errors. I tried to download a zip file of a commit, and while it should be around 12GB with all the files it was just over 600MB.
Does anyone know how to import repositories in DevOps with LFS enabled correctly?
What if my source repository contains Git LFS objects?
Git import will not import Git LFS objects.
LFS objects can be moved using the following steps:
- Import the repository using import repository feature into Azure DevOps. This will copy over all the Git objects from source to Azure DevOps (this will also import the LFS pointers which are Git objects but not the LFS files)
To move over the LFS files (you will need both Git.exe and LFS client in the same box and access to both source repository and destination repository)
- Clone the imported repository from Azure DevOps to local system, clone will work but it will fail while performing checkout of LFS files
- Add the source repository as remote (say ‘source’)
git remote add source <SOURCE_URL>- Perform
git lfs fetch source -–all(this will bring over all LFS files from source to your local repository)- Assuming the destination VSTS repository is your ‘target’ remote
- Perform
git lfs push target -–all
https://learn.microsoft.com/en-us/azure/devops/repos/git/import-git-repository?view=azure-devops#what-if-my-source-repository-contains-git-lfs-objects
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With