Reputation: 153
We have a huge SVN repository (~100GB) that we are trying to migrate to Git. Problem is that, the repo contains lots of binary files spread across the folder tree.
First thing that we thought is to move the binaries to Git-LFS, but there's some questions that we need to address before:
Thanks
Upvotes: 13
Views: 1712
Reputation: 3333
I think I've found the answer for this, though haven't completed testing it myself (the first step takes many hours for our repository). The trick is from this Atlassian documentation:
https://confluence.atlassian.com/bitbucket/use-bfg-to-migrate-a-repo-to-git-lfs-834233484.html
This is specific to bitbucket, but I imagine it would work with any git repository.
Step 1: First step is to convert the SVN project to git. This can be done with git-svn
as described here:
https://john.albin.net/git/convert-subversion-to-git
That page also described ways to carry over the authors and add in the extra details allowed in git authors (real name and email).
Step 2: Now follow the instructions in the above Atlassian documentation to use the "BFG Repo-Cleaner" replace all "big files" in your history with references to git LFS. This is a simpler tool to do some of the things that can also be done with the git-filter-branch
tool.
I could give step-by-step instructions here, but I'd just be copying from those other sources, and I haven't actually tried it myself yet (running now). I'll update again when I've seen the results here.
EDIT: I forgot to update this when I'd finished testing almost two years ago, and just noticed now because I got an upvote. From what I remember, I ended using git lfs migrate
instead of BFG to migrate large files out of the repo and into git LFS. (https://github.com/git-lfs/git-lfs/wiki/Tutorial)
Upvotes: 4