Main problem:
I pushed a repository completely converted to LFS back to bitbucket, but the repository remains large.
Backstory:
Tests
After many tests and backups, I was successfully able to convert an existing repository to LFS. My initial tests were creating a mirror from a local repository, and using git lfs migrate to convert it. Locally, I was experiencing an issue where the objects/ STAYED the same size, but LFS files were ALSO created, effectively doubling the repository size. I resolved this issue when I cloned a mirror from bitbucket. There may have been a rogue branch locally that retained these files.
Now that the local repository was fully converted (lfs/ is big, objects/ is small) I pushed it to a NEW repository in bitbucket. All was well.
Script
So, I worked on creating a script that would MIGRATE an existing repository. I have successfully executed the script locally, and the bare mirror looks correct with much of the storage space migrated from objects to lfs. However, I am experiencing issues when I attempt to push it up to bitbucket remote.
- The first time, it seemed to push successfully, but no LFS files were uploaded.
- On an investigation of the bitbucket history, the files I looked for showed they were in LFS, but the files didn't seem to exist.
- I manually did git lfs push --all origin and they all showed up.
- The settings of the repository showed the correct amount of LFS space was now used
- The repository size did NOT go down.
- I've tried several incantations of git push in an attempt to resolve this with no luck.
- I've waited 12 hrs hoping that it might be a git gc issue on the bitbucket end.
Full Question
The actual intent here is to reduce the size of many repositories by migrating to LFS. My understanding is that git push --mirror --force should REWRITE history and replace everything.
I can't figure out why the git history is still large on bitbucket while locally, it is not.
- What should I look for?
- How do I resolve this?