Search code examples
githubfluttercommitgit-commit

File ios/Flutter/Flutter.framework/Flutter is 351.71 MB; this exceeds GitHub's file size limit of 100.00 MB


I am trying to push my latest commit to GitHub. But is is showing me following error:

remote: Resolving deltas: 100% (43/43), completed with 41 local objects.
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: c8bf146b362d19d128f2ffe74b5b5b9d
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File ios/Flutter/Flutter.framework/Flutter is 351.71 MB; this exceeds GitHub's file size limit of 100.00 MB
To https://github.com/ChandraPrakashJangid/geo_tags.git
 ! [remote rejected] master -> master (pre-receive hook declined)

Solution

  • seems like you're pushing your build folder and other generated files to github. Edit you .gitignore file to push only the lib and other necessary files.

    a sample flutter .gitignore file would look like this

        # Miscellaneous
    *.class
    *.log
    *.pyc
    *.swp
    .DS_Store
    .atom/
    .buildlog/
    .history
    .svn/
    
    # IntelliJ related
    *.iml
    *.ipr
    *.iws
    .idea/
    
    # The .vscode folder contains launch configuration and tasks you configure in
    # VS Code which you may wish to be included in version control, so this line
    # is commented out by default.
    #.vscode/
    
    # Flutter/Dart/Pub related
    **/doc/api/
    .dart_tool/
    .flutter-plugins
    .packages
    .pub-cache/
    .pub/
    /build/
    
    # Android related
    **/android/**/gradle-wrapper.jar
    **/android/.gradle
    **/android/captures/
    **/android/app/release/
    **/android/gradlew
    **/android/gradlew.bat
    **/android/local.properties
    **/android/**/GeneratedPluginRegistrant.java
    
    # iOS/XCode related
    **/ios/**/*.mode1v3
    **/ios/**/*.mode2v3
    **/ios/**/*.moved-aside
    **/ios/**/*.pbxuser
    **/ios/**/*.perspectivev3
    **/ios/**/*sync/
    **/ios/**/.sconsign.dblite
    **/ios/**/.tags*
    **/ios/**/.vagrant/
    **/ios/**/DerivedData/
    **/ios/**/Icon?
    **/ios/**/Pods/
    **/ios/**/.symlinks/
    **/ios/**/profile
    **/ios/**/xcuserdata
    **/ios/.generated/
    **/ios/Flutter/App.framework
    **/ios/Flutter/Flutter.framework
    **/ios/Flutter/Generated.xcconfig
    **/ios/Flutter/app.flx
    **/ios/Flutter/app.zip
    **/ios/Flutter/flutter_assets/
    **/ios/Flutter/flutter_export_environment.sh
    **/ios/ServiceDefinitions.json
    **/ios/Runner/GeneratedPluginRegistrant.*
    
    # Exceptions to above rules.
    !**/ios/**/default.mode1v3
    !**/ios/**/default.mode2v3
    !**/ios/**/default.pbxuser
    !**/ios/**/default.perspectivev3
    !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages