How can I upload my project to Github when it exceeds 100 MB?

I use the GoogleMaps module, which is 130 MB, so github will not let me download my project. What is the workaround for this?

enter image description here

+4
source share
5 answers

I suggest excluding the Pods directory (by adding it to your .gitignore file) in the git repository. Pods can be recreated with your podfile, so you do not need to store them in your repository.

Another approach, for example. when you have a framework you previously compiled and don't want your other team members to need to compile it, use git lfs: https://git-lfs.github.com

+5
source

Google Maps SDK , .gitignore, , , LFS - .

Swift, Xcode Swift Package Manager (SPM), SDK Maps Package.swift . swift build ( Xcode) , .

+1

:

   post_install do |installer_representation|
        puts "Splitting up Gooogle Framework - It just too big to be presented in the Github :("
        Dir.chdir("Pods/GoogleMaps/Frameworks/GoogleMaps.framework/Versions/Current") do
           # Remove previous split files if any
           `rm GoogleMaps_Split_*`
           # Split current framework into smaller parts
           `split -b 30m GoogleMaps GoogleMaps_Split_`
        end
    end
  1. .gitignore
    # Google Maps is too big to be handled by one file, so this one is generated on build phase from smaller pieces
    OurProject/Pods/GoogleMaps/Frameworks/GoogleMaps.framework/Versions/A/GoogleMaps
# Github doesn't support files bigger than 100M.
# Latest checked GoogleMaps Framework ~ 114M
# We're expecting to have GoogleMaps Framework as a one file or as a number of chunks

BINARY_FILENAME=GoogleMaps
SPLIT_FILENAME_PREFIX=${BINARY_FILENAME}_Split
GMAPS_FRAMEWORK_DIR=Pods/GoogleMaps/Frameworks/GoogleMaps.framework/Versions/Current
GMAPS_FRAMEWORK_FILE=$GMAPS_FRAMEWORK_DIR/$BINARY_FILENAME

# Check if we  have Google Maps Framework
if [ ! -f ${GMAPS_FRAMEWORK_FILE} ]; then
    echo "There no Google Maps framework at ${GMAPS_FRAMEWORK_FILE}"
    cd ${GMAPS_FRAMEWORK_DIR}
    #  But we have chunks! ...Probably
    if [ -f ${SPLIT_FILENAME_PREFIX}_aa ]; then
       echo "Creating file from smaller files with ${SPLIT_FILENAME_PREFIX} prefix"
       cat ${SPLIT_FILENAME_PREFIX}_* > ${BINARY_FILENAME}
    fi
fi
+1
0

Github 100 . 1 .

, , , . , Git Large File Storage, .

. GitHub, Git Large File Storage (Git LFS) . Git LFS GitHub Flow , . . " .

However, in this case it really looks like you should either create a submodule or use it with .gitignore to remove the framework from the repository.

0
source

Source: https://habr.com/ru/post/1622152/


All Articles