4

I'm trying to convert an svn repo to git and i want to keep the large files. These are the commands i use do to it:

git svn clone https://mysvnrepo

Manually create a new repository on our github enterprise site.

git remote add origin https://github.com/myrepo
git push -u origin master

It throws an error saying that the files are over 100 MB. I added the .gitattributes right before the push. All the tutorials that i have seen either don't mention this or tell me to delete the files which i have tried but for some reason it still sees all of the files i deleted and won't let me continue. I know that LFS works for other people but since this is a transfer from svn I'm not sure why this isn't working.

developer101
  • 63
  • 1
  • 6
  • This is not how you migrate SVN to Git. It's considerably more work than this, even without LFS. See for example https://www.atlassian.com/git/tutorials/migrating-overview – Dan Lowe Jul 17 '17 at 19:41
  • 1
    This has worked for the other 5 repositories that didn't have the 100 MB files and all the history transferred over fine. I've seen steps where it connects the history with github users but we dont care about that. Also i forgot the step right after the clone where i would manually create the github repository on our github enterprise site. – developer101 Jul 17 '17 at 20:33
  • 1
    Deleting the files from the current HEAD won't do it... they're still in your history. You have to rewrite the history to remove them and convert them to LFS... Atlassian has a tutorial on that also (talks about Bitbucket but it's just as applicable to Github/GHE) https://confluence.atlassian.com/bitbucket/use-bfg-to-migrate-a-repo-to-git-lfs-834233484.html – Dan Lowe Jul 17 '17 at 20:38

1 Answers1

5

after you converted yourSVN repo to git you need to convert it to git lfs before pushing it. Here is the complete guide: https://github.com/git-lfs/git-lfs/wiki/Tutorial

Yosef-at-Panaya
  • 676
  • 4
  • 13