Git-lfs: How to force LFS to re-upload binary assets

Created on 30 Oct 2017  路  4Comments  路  Source: git-lfs/git-lfs

I have a git lfs repo I'm building. I am using Artifactory as the LFS binary storage. It works. I successfully uploaded several binaries.

I had to rename the LFS binary repo. Artifactory doesn't let you rename a repo; you have to create a new one.

I did that, and reconfigured the .gitattributes file to point to the new LFS repo URL. I also took an extra, possibly-misguided step, of deleting the old binary repo. So now I have a new, empty, LFS binary repo, and local git repo configured to point to the empty repo.

However, git-lfs still thinks the binaries have already been uploaded.

How can I re-populate the binary repo with already-pushed assets?

I tried several things, but all basically boil down to me re-running the git push command.

Is there an easy way to re-populate the binary repo?
Is there any way to do this?

Most helpful comment

You can run git lfs push --all to scan all refs for LFS objects. It does depend on your server reporting back that it doesn't have the objects, though.

All 4 comments

You can run git lfs push --all to scan all refs for LFS objects. It does depend on your server reporting back that it doesn't have the objects, though.

Ok, thanks. I did do that, it went and skipped all 4 binaries that it thought it had already uploaded. The LFS repo is completely empty, though, so I'm not sure why it would report back anything other than that it does not have the objects. Unless it isn't reporting back anything.

It turns out that my needs are so simple, the added complexity of using LFS doesn't make sense at this time. So I'm not going to pursue this any further.

Thanks for the help.

Ok, thanks. I did do that, it went and skipped all 4 binaries that it thought it had already uploaded.

Well, that's on your server reporting back that it has the files. Artifactory did have an API bug that mistakenly reported that too.

Thanks a lot for git lfs push --all - I put my repo on a noexec file system (due to encryption) and my git push did not upload the files but reported

hint: The '.git/hooks/pre-push' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
Everything up-to-date

After setting the filesystem to exec in /etc/fstab I was able to upload all missing files using git lfs push --all.

Was this page helpful?
0 / 5 - 0 ratings