-1

I have a large size of project that I push to GitHub and there is limit size to push files to GitHub, so I am trying to push only a folder that contains some files so I do this:

git add android/
git commit -m "my commit"
git push origin dev

but I got this response:

remote: error: File build/ios/Release-iphoneos/Flutter.framework/Flutter is 414.78 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
To https://github.com/mygit/projectrepo
 ! [remote rejected]   dev -> dev (pre-receive hook declined)
error: failed to push some refs to 'https://...'

It seems like I still push all of the file although I do git add android/ because build/ios/Release-iphoneos/Flutter.framework/Flutter is outside of android folder Is there a way to solve this ?

wahyu
  • 1,679
  • 5
  • 35
  • 73
  • This seems like build result file. Are you sure you want to have it versioned in git? If so you should look into using **git lfs** to track large files – Pieterjan Aug 20 '21 at 06:07
  • 2
    You should ideally ignore everything that's generated. Look at [this](https://stackoverflow.com/questions/52286143/what-is-a-legit-gitignore-for-a-flutter-project-that-is-developed-in-android-st) for an example of a `.gitignore` for Flutter projects. – maazadeeb Aug 20 '21 at 06:07
  • It seems like you might not have reset the commits. Try resetting to a commit before the current one and then try commit and push again. If you have tried this, then one possible way is to ignore the files you don't want to be tracked by git by using .gitignore. More information about its usage is [here](https://git-scm.com/docs/gitignore) – P0intMaN Aug 20 '21 at 06:08
  • Also, if you've already committed something to your github repository (unlikely, based on your question), you can still ignore it. See [this](https://www.git-tower.com/learn/git/faq/ignore-tracked-files-in-git/) – maazadeeb Aug 20 '21 at 06:10
  • 3
    You cannot push a *file* to another repository. You can only push *commits*. Commits contain files, and link back to previous commits. You have a commit that has a big file in it, and GitHub are rejecting that *commit*. You'll have to stop pushing that particular *commit*. Remember that pushing a new commit also pushes any *previous* commits that lead up to that commit. – torek Aug 20 '21 at 06:19
  • You're pushing an entire iOS build of your app to GitHub. That's not how Git should be used, it isn't intended to hold binary files. Create a .gitignore that ignores your built files, remove the commit and try again. – Private_GER Aug 20 '21 at 06:40
  • @Pieterjan,@maazadeeb,@P0intMaN,@torek,@Private_GER, Hi guys thank you very much for the suggestion, I have tried to undo my commit and re-commit again for specific files and it works... thank you very much for the suggestions – wahyu Aug 20 '21 at 06:51
  • https://stackoverflow.com/search?q=%5Bgit%5D+remote%3A+error%3A+GH001%3A+Large+files+detected – phd Aug 20 '21 at 13:26

1 Answers1

0

If you do not want to use GIT LFS for binary files, If you use Git enterprise server, the administrator can change the limits to more than 100mb, at least temporarily if you need to.

More information at the following link, https://docs.github.com/en/enterprise-server@3.1/github/managing-large-files/working-with-large-files/conditions-for-large-files

Shaqil Ismail
  • 1,794
  • 1
  • 4
  • 5