3 ms·
I used this yesterday to move 400 MB of binary files from a repo on github to git-lfs. Works great. The workflow was roughly: - cp *.mov (and a few other l
by tlb 11y ago
I used this yesterday to move 400 MB of binary files from a repo on github to git-lfs. Works great.
The workflow was roughly:
- cp *.mov (and a few other large blob types) ~/tmp
- git rm *.mov
- git commit
- git lfs track *.mov
- git add .gitattributes
- git commit; git push
In a fresh directory:
- git clone --mirror $remote; cd repo
- bfg --delete-files '*.mov'
- git reflog expire --expire=now --all && git gc --prune=now --aggressive
- git push
Back to my src directory:
- mv repo repo.bloated
- git clone $remote; cd repo
- cp ~/tmp/*.mov .
- git add *.mov (it now puts them in lfs)
- git commit; git push
Kind of a chore to figure out, but now my repo is small and zippy.
Tip: do this on a cloud machine instead of your laptop, since most of the time is pulling/pushing data to github.