We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.
cocos2d-x github repository is huge (and slow)
cocos2d-x github repository is huge (and slow)
How to do it:
Search for "remove binary files from git history" in google you will find:
I finally compressed .git
folder from 730.8 MB
to 285.8 MB
The way is:
java -jar ~/Software/bfg.jar -b 1M -D '.{obj,o,exe,dll,apk,so,a,ipa,pdb,ilk,exp,lib,suo,ncb,sdf,sbr,opensdf,swp,swo,png,jpg,jpeg,tiff,mp3,mp4,ogg,wav,caf,pvr,zip,rar,ccz,gz,webp,ttf,bmp}' git reflog expire --expire=now --all git gc --prune=now --aggressive
Did this data fix our needs?
ok, thanks. yes, we need to remove the huge binaries from all all the branches.
I used that tool to remove file which is larger than 1M
and which has extension of exe,dll,apk,so,a,ipa,pdb,ilk,exp,lib,suo,ncb,sdf,sbr,opensdf,swp,swo,png,jpg,jpeg,tiff,mp3,mp4,ogg,wav,caf,pvr,zip,rar,ccz,gz,webp,ttf,bmp
Updated:
Finally, I made the repo size reduced to 146M
. It seems that there are no more gaps to make it smaller.
You could clone my repo to test it.
git clone https://github.com/angeltown/cocos2d-x.git Cloning into 'cocos2d-x'... remote: Counting objects: 203896, done. remote: Compressing objects: 100% (65972/65972), done. remote: Total 203896 (delta 135728), reused 195255 (delta 130873) Receiving objects: 100% (203896/203896), 146.59 MiB | 672.00 KiB/s, done. Resolving deltas: 100% (135728/135728), done. Checking connectivity... done.
The command i used is:
java -jar ~/Software/bfg.jar -b 200K -D '*.{plist,json,ExportJson,z,obj,o,exe,dll,apk,so,a,ipa,pdb,ilk,exp,lib,suo,ncb,sdf,sbr,opensdf,swp,swo,atlas,bmp,caf,ccb,ccbi,ccbproj,ccbresourcelog,ccz,dds,fnt,fsh,gz,jpeg,jpg,ktx,mid,mp3,ogg,pkm,png,ppng,pvr,pvrraw,raw,tga,tiff,tmx,tps,tsx,ttf,wav,webp,zss,ztp}' git reflog expire --expire=now --all git gc --prune=now --aggressive
thanks. not bad :)
but it is still a bit slow for me
I'm wondering if the test assets could be improved.
As an example, I know that we moved resources from directory to another many times.
The move operations (remove + add) were done in one single commit ? or in two (remove first, and then add) ?
If those operations were done one commit, then git will will treat it as a "rename"... otherwise, it will tread it as a "remove", and then "add".... and that will make the git history pretty big.
Eventually, repo size is about 50M now.
You could use https://github.com/angeltown/cocos2d-x.git to test.
But I will re-add resources which was removed. The size may be increased to about 80M.
git clone git://github.com/angeltown/cocos2d-x.git Cloning into 'cocos2d-x'... remote: Counting objects: 197081, done. remote: Compressing objects: 100% (57377/57377), done. remote: Total 197081 (delta 132402), reused 184353 (delta 131784) Receiving objects: 100% (197081/197081), 56.79 MiB | 614.00 KiB/s, done. Resolving deltas: 100% (132402/132402), done. Checking connectivity... done.
Context:
If you try to clone cocos2d-x it will take a lot of time.
And this is because we are adding binary files (libraries in particular) to the github repo.
And when you clone the github repo, it downloads all the history... so it downloads all the binary libraries that we added.
Problem 1:
Cloning the repo takes a lot of time. Not good for developers, and not good for contributors.
Problem 2:
Since it takes a lot of time, using cocos2d-x as a subrepo is not an option for many projects.
Solution:
Additionally: