简体   繁体   中英

Migrate an svn repo with large files to a new git repo?

I have converted my svn repo, with files larger than 100 mb, into a git repo with git-svn. Everything went swimmingly. Then I attempted to upload the repo to GitHub, and I got an error that a file was too large. I followed the link to git lfs , I set it up without a hitch. I assigned the file extensions of the files that were too large to the .gitattributes section, and during my upload, everything seemed to work well. git lfs uploaded the large files, and then git uploaded the rest - but there was still the same error from the same file! So I looked for this file, and I couldn't find it within the repo. I think it must have been made in an earlier commit, and later deleted. I suppose I could delete the tracked, large file, but that would be editing the history. Is there any way for lfs to track files in previous commits when uploading a repo? Or is something else going on? Here's my console output:

➜  automated_design git:(master) git push -u origin master
Uploading LFS objects: 100% (134/134), 216 MB | 6.0 MB/s, done                  
Counting objects: 44692, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (7171/7171), done.
Writing objects: 100% (44692/44692), 1.75 GiB | 4.79 MiB/s, done.
Total 44692 (delta 37828), reused 44158 (delta 37460)
remote: Resolving deltas: 100% (37828/37828), done.
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: 247de6add2c0943c33f0d5b1e57c8155
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File Final Designs/ADT Designs/EtFlocSedFi/EtFlocSedFi Spanish 2.rtf is 101.13 MB; this exceeds GitHub's file size limit of 100.00 MB
To https://github.com/AguaClara/mathcad.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/AguaClara/mathcad.git'
➜  automated_design git:(master) cat .gitattributes 
*.psd filter=lfs diff=lfs merge=lfs -text
*.docx filter=lfs diff=lfs merge=lfs -text
*.dwg filter=lfs diff=lfs merge=lfs -text
*.rtf filter=lfs diff=lfs merge=lfs -text
➜  automated_design git:(master) 

Any help is much appreciated!!

I ended up using BFG Repo-Cleaner to clean all the large files out of my previous commits. It worked very well. Then I pushed the repo and no more error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM