I have an existing non Git-LFS repo that I want to implement Git LFS on and I'm reading https://confluence.atlassian.com/bitbucket/use-git-lfs-with-existing-bitbucket-repositories-829078749.html. What is the order of events? Do I...
Then follow the instructions on BFG? https://confluence.atlassian.com/bitbucket/use-bfg-to-migrate-a-repo-to-git-lfs-834233484.html
It's NOT clear from the links WHEN to convert the existing repo to use Git LFS
Hi Chris,
Welcome to the Atlassian Community.
The order of events should be:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No, it just tells Git that files with that extension will be handled by LFS, the actual conversion happens when you run BFG for existing files. If you do not run BFG, existing file would not be handled by LFS.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So the BFG step (#6) is run in a clone mirror (git clone --mirror) which is a bare repo, at least per https://confluence.atlassian.com/bitbucket/use-bfg-to-migrate-a-repo-to-git-lfs-834233484.html?_ga=2.229845012.96814952.1529633258-482757227.1527186133. I'm missing on WHEN the Git LFS objects are created. Thanks again!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
After I ran BFG on my mirror clone, I did a git push origin --force, per the BFG link, and I do NOT see any Git LFS objects on my repo in Bitbucket.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The objects are created when you push the converted repository back, step 5 in the link above. Note that if you have already run the git lfs install, you can skip step 4.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And a subsequent clone of the repo gives...
Downloading MarcomLite/lib/jets3t-0.6.1/cockpit-0.6.1.jar (144 KB)
Error downloading object: MarcomLite/lib/jets3t-0.6.1/cockpit-0.6.1.jar (716be41): Smudge error: Error downloading MarcomLite/lib/jets3t-0.6.1/cockpit-0.6.1.jar (716be4107b362e413dc1ae29dc88e9b79e680def2c725ecc2d73268c4ea66e75): [716be4107b362e413dc1ae29dc88e9b79e680def2c725ecc2d73268c4ea66e75] Object does not exist on the server: [404] Object does not exist on the server
What am I missing?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hmm, sounds like something failed during the conversion, have a look at this troubleshooting guide. You should be able to see the file when you navigate to it in Bitbucket or locally in your repository.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If everything went as expected the files handled by LFS will show up as regular files in the repository.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The "error" (it seems to me anyway) was with the instructions of the BFG page, where it tells you to
I ran bfg on a non-mirror clone and all worked. Because if you think about it, how can you create objects on a "bare" repo?
But I still feel like I'm missing something.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When I ran it I used these steps, comparing them to what is in the Bitbucket docs the thing missing is the garbage collection before the push, but normally Bitbucket does its own gc when you push anything to it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I take this back, I still have git clone errors, Git LFS objects does not exist on the server!
Though I see Git LFS files on the BB GUI
Downloading MarcomLite/lib/jets3t-0.6.1/cockpit-0.6.1.jar (144 KB)
Error downloading object: MarcomLite/lib/jets3t-0.6.1/cockpit-0.6.1.jar (716be41): Smudge error: Error downloading MarcomLite/lib/jets3t-0.6.1/cockpit-0.6.1.jar (716be4107b362e413dc1ae29dc88e9b79e680def2c725ecc2d73268c4ea66e75): [716be4107b362e413dc1ae29dc88e9b79e680def2c725ecc2d73268c4ea66e75] Object does not exist on the server: [404] Object does not exist on the server
On my local repo I ran BFG against
$ git show HEAD:MarcomLite/lib/jets3t-0.6.1/cockpit-0.6.1.jar
version https://git-lfs.github.com/spec/v1
oid sha256:716be4107b362e413dc1ae29dc88e9b79e680def2c725ecc2d73268c4ea66e75
size 143768
$ ls .git/lfs/objects/71/6b
716be4107b362e413dc1ae29dc88e9b79e680def2c725ecc2d73268c4ea66e75
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I take this back, I still have git clone errors, Git LFS objects does not exist on the server!
Though I see Git LFS files on the BB GUI
Downloading MarcomLite/lib/jets3t-0.6.1/cockpit-0.6.1.jar (144 KB)
Error downloading object: MarcomLite/lib/jets3t-0.6.1/cockpit-0.6.1.jar (716be41): Smudge error: Error downloading MarcomLite/lib/jets3t-0.6.1/cockpit-0.6.1.jar (716be4107b362e413dc1ae29dc88e9b79e680def2c725ecc2d73268c4ea66e75): [716be4107b362e413dc1ae29dc88e9b79e680def2c725ecc2d73268c4ea66e75] Object does not exist on the server: [404] Object does not exist on the server
On my local repo I ran BFG against
$ git show HEAD:MarcomLite/lib/jets3t-0.6.1/cockpit-0.6.1.jar
version https://git-lfs.github.com/spec/v1
oid sha256:716be4107b362e413dc1ae29dc88e9b79e680def2c725ecc2d73268c4ea66e75
size 143768
$ ls .git/lfs/objects/71/6b
716be4107b362e413dc1ae29dc88e9b79e680def2c725ecc2d73268c4ea66e75
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I went back and checked my notes I created when doing this and after I ran the gc on the repository, I also did git lfs init on it:
BFG rewrites history, extracting files to lfs/objects and adding .gitattributes for LFS tracking. Now we need to strip out the large files,run a garbage collection and enable Git LFS on the repository.
git reflog expire --expire=now --all && git gc --prune=now
git lfs init
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I take this back, I still have git clone errors, Git LFS objects does not exist on the server!
Though I see Git LFS files on the BB GUI
Downloading MarcomLite/lib/jets3t-0.6.1/cockpit-0.6.1.jar (144 KB)
Object does not exist on the server: [404] Object does not exist on the server
On my local repo I ran BFG against
$ git show HEAD:MarcomLite/lib/jets3t-0.6.1/cockpit-0.6.1.jar
version https://git-lfs.github.com/spec/v1
oid sha256:716be4107b362e413dc1ae29dc88e9b79e680def2c725ecc2d73268c4ea66e75
size 143768
$ ls .git/lfs/objects/71/6b
716be4107b362e413dc1ae29dc88e9b79e680def2c725ecc2d73268c4ea66e75
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
git lfs init has been replace by git lfs install.
After you pushed the bare repository back to Bitbucket, did you make a new local clone or just continued using your old repository? It is recommended to delete the old clone and create a new one, since your old clone still thinks that your files that was just converted are still stored within the repository instead of handled via LFS.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.