0

I've tried to push data to github, but got error

remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: 175fa38dfe7c67becde0232ae3469018
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File Pods/FirebaseMLVisionTextModel/Frameworks/FirebaseMLVisionTextModel.framework/FirebaseMLVisionTextModel is 302.51 MB; this exceeds GitHub's file size limit of 100.00 MB
To https://github.com/paulo-bellator/MoneyFlow.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/paulo-bellator/MoneyFlow.git'

I deleted the whole pod (by reinstalling pods), in which that file was. And tried again. Same error.

I tried

git rm --cached "myFilePath"

but file wasn't found.

fatal: pathspec 'Pods/FirebaseMLVisionTextModel/Frameworks/FirebaseMLVisionTextModel.framework/FirebaseMLVisionTextModel' did not match any files

I also tried

git commit --amend -CHEAD

Get this response. Then trying to push, but again got same error

MacBook-Air-Nikita:MoneyFlow nikitagoncharov$ git commit --amend -CHEAD
[master 65e9e7a] remove MLVisionTextRecognizing model
 Date: Wed Oct 9 13:57:22 2019 +0300
 30 files changed, 2965 insertions(+), 4612 deletions(-)

Finally tried this command, but nothing happened.

git filter-branch

So i'm still getting this error, and can't push my data.

remote: error: GH001: Large files detected

What should i do to remove this file from git, and finally push my data into github?

Nikita Goncharov
  • 173
  • 2
  • 13
  • When exactly (in terms of git history) this file was added? Is it in the latest commit? – sbat Oct 09 '19 at 13:17
  • @sbat 'Wed Oct 9 13:57:22 2019 +0300 remove MLVisionTextRecognizing model – Nikita Goncharov Oct 09 '19 at 13:21
  • @sbat 'Sun Sep 29 00:47:50 2019 +0300 add VisionTextRecognizer to parse ops from screens' – Nikita Goncharov Oct 09 '19 at 13:22
  • @sbat i added this file on another branch, and stay there for a long time. Few days ago, i merged that branch into master. And trying to push master, but it fails – Nikita Goncharov Oct 09 '19 at 13:24
  • In that case I'd second the suggestion above to use filter-branch. You need to change all your new commits and remove this large file from each one of them. Question linked above by @LasseVågsætherKarlsen should cover this. Just make sure you pass your original commit with this particular file to it (not --all) to make sure you only change your new commits (just in case). Backing up entire repo before that is good idea. – sbat Oct 09 '19 at 13:32
  • @sbat, thanks! I've solved the problem – Nikita Goncharov Oct 15 '19 at 12:01

1 Answers1

1

Find this solution in this question

There are lot of answers there and most of them are extremely complicated for me (i'm newbie with git), but this solution seemed me simple and it's worked perfect!

Solution:

git filter-branch --tree-filter 'rm -f file-to-be-removed-name' HEAD
Nikita Goncharov
  • 173
  • 2
  • 13