1

I cannot push new changes to my remote GitHub repository because my IOS Swift project uses the opencv framework, which is 150 MB large. I get the following error message:

remote: error: GH001: Large files detected. 
You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: ......aa11d45...12994...
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File Pods/OpenCV/opencv2.framework/Versions/A/opencv2 is 150.06 MB; this exceeds GitHub's file size limit of 100.00 MB
 ! [remote rejected] master -> master (pre-receive hook declined)

I have try the Large File Storage, by running the following command line commands:

git lfs track "Pods/OpenCV/opencv2.framework/Versions/A/opencv2"
git add .gitattributes

but I still get the same error message.

How can I push changes to GitHub when I have a large framework file like opencv2.

AJ Z.
  • 495
  • 7
  • 19
  • 1
    Are you really obliged to commit (and track) this file? Isn't there a package manager in swift? At least, just commit a script to install it... – Philippe Jan 28 '18 at 16:03
  • 1
    Possible duplicate of [git commit error: large file detected](https://stackoverflow.com/questions/36027729/git-commit-error-large-file-detected) – phd Jan 28 '18 at 17:01

1 Answers1

0

There could be two reasons,

  1. You missed the run git install lfs in repository directory. Please follow commands like

git install lfs

git lfs track "Pods/OpenCV/opencv2.framework/Versions/A/opencv2"

git add .gitattributes

  1. There could be previous commits that have a large file without lfs track, so you might need to reset your repository, I recommend to clone repo in another directory then,

    • Install the lfs (git install lfs),

    • Copy the large file in repo directory,

    • Let lfs track the files

then, commit and push.

Ömer Taban
  • 130
  • 1
  • 5