In a moment of delirium before a deadline, I added a large (> 100 MB) binary to a repository with remotes on private hosts as well as github. Of course, github complained, and naively trusting their suggestion, I opted to use LFS.
After two or three commits: my repository reached github's LFS data quota, I had to rename all my remotes to origin
, had to explicitly add all my .ssh/config
information into git remote set-url
for all remotes, and could no longer use any other computers as remotes over ssh*.
My current status is this: Several commits in my main working local repository, a few of which contain LFS files. Up to the last few commits, they have been pushed to github (until I reached quota), which could then be manually pulled from github to my other remotes, but not pushed to them from my local. I cannot bypass github to get my files to the other remotes because of the quota.
How can I clean the repo of LFS so that I can use git-annex? Ideally without fully rebasing from before the first LFS commit, but I imagine that is unavoidable. My question is the inverse, then, of How to migrate from Git-Annex to Git LFS, because I seem to be missing the bandwagon.
I'd be happily convinced that LFS is somehow actually useful for my case.
*I can't find this last issue documented anywhere, only mentioned in this answer and hinted at (but not directly stated) by various error messges. Of course if this were documented I'd never have opted for LFS in the first place, since it makes git effectively centralized again.
A common use case for the migrate command is to convert large Git objects to LFS before pushing your commits. By default, it only scans commits that don't exist on any remote, so long as the repository is non-bare.
Step 1: Download and Install Git-lfs ( Git Large File Storage ) from here. Step 2: Setup Git lfs for your user account git lfs install . Step 3: If you have already tried to commit large files and got the error then you must first undo the commit, use git reset — soft HEAD~1 otherwise ignore this step.
As mentioned in my comment, issues with recovering binaries commited to the git-lfs can be found here.
Even with a commit recovery it seems likely a rebase will be required in order to return the repository to a working condition - ie. being able to push from all the endpoints.
Perhaps the binaries should be stored outside the git solution? When working on projects with large assets (game development), I used to use Dropbox for the larger assets (which gave easy access to other project members), and git only for the code content.
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