Search code examples
gitgithubgitignoregoogle-maps-sdk-ios

How to ignore a directory in git


So the latest version of the GoogleMaps framework is 123MB, which causes all kinds of problems with GitHub's 100MB limit. I tried Large File Storage, but that doesn't work. So now I'm trying to ignore my Pods directory. I edited my .gitignore file to look like this:

# Xcode
.DS_Store
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
*.xcworkspace
!default.xcworkspace
xcuserdata
profile
*.moved-aside
DerivedData
.idea/

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
Pods/

But when I try to push, I still get the same file-too-large error from the GoogleMaps Pod. What am I missing?

EDIT: Here's the exact error for those that don't believe it:

File Pods/GoogleMaps/Frameworks/GoogleMaps.framework/Versions/A/GoogleMaps is 123.00 MB; this exceeds GitHub's file size limit of 100.00 MB

Solution

  • This is a GitHub problem.

    You will need to make sure that the file is not in your repo at all. This means removing the file from all commits. Adding a file to .gitignore does not remove files from Git if you have already added them, and removing a file from the latest commit does not remove the file from the repo because the file still exists in the repo history (in other words, git rm does not help).

    To completely remove the file, edit history. See: Completely remove file from all Git repository commit history