SVN to Git with Git-LFS

We have a huge SVN repository (~ 100 GB), which we are trying to port to Git. The problem is that the repo contains many binary files distributed over the folder tree.

First of all, we decided to move the binaries to Git-LFS, but there are some issues that we need to solve before:

  • We need to keep a commit history. Is it possible to replace the binary with the LFS file pointer in previous commits?
  • We use several branches. During validation, Git -lfs caches existing binaries, so inter-branch verification will not include reloading these binaries again and again.
  • Does Git-LFS support one binary in different branches, or should we duplicate each binary for each branch on the server?
  • Is it possible to perform partial verification of binary files during the checkout process? Therefore, if necessary, only some parts of the binary files will be downloaded.
  • On the server, how should these binaries be stored? Is there a server application needed to store these binary files, or will a simple HTTP / FTP server do?

thanks

+7
git version-control git-lfs
source share
1 answer

I think I found an answer for this, although I did not finish testing it myself (the first step takes a lot of time for our repository). The trick from this atlas documentation:

https://confluence.atlassian.com/bitbucket/use-bfg-to-migrate-a-repo-to-git-lfs-834233484.html

This is specific to bitbucket, but I assume that it will work with any git repository.

Step 1: The first step is to convert your SVN project to git. This can be done using git-svn as described here:

https://john.albin.net/git/convert-subversion-to-git

This page also describes how to transfer authors and add additional information allowed in git Authors (real name and email address).

Step 2: Now follow the instructions in the above Atlassian documentation to use the “BFG Repo-Cleaner” to replace all the “large files” in your history with links to git LFS. This is a simpler tool to do some things that can also be done with the git-filter-branch tool.

I could give step-by-step instructions here, but I would just copy from these other sources, and I have not tried it myself yet (now it works). I will update again when I see the results here.

0
source share

All Articles