The -c
flag doesn't seem to be supported any more, but here's what you can do.
At the time of writing,
repo init -u https://android.googlesource.com/platform/manifest -b android-5.1.0_r5
creates 33GB worth of files.
Adding --depth=1
reduces this to 21GB.
Adding --groups=all,-notdefault,-device,-darwin,-x86,-mips,-exynos5
to exclude devices and components you're not interested in reduces this to 19GB.
For storage only, you could remove the checked-out files for each .git repository inside .repo/ to save even more space, but I'm not sure how to script this. If you did do this, repo sync
would check out the "missing" files when needed.
For reference, my complete command line was
repo init -u https://android.googlesource.com/platform/manifest -b android-5.1.0_r5 --depth=1 --groups=all,-notdefault,-device,-darwin,-x86,-mips,-exynos5,mako
so this tree would only work for the Nexus 4. I have not yet tried to build from this tree but there's no reason it wouldn't work.
You could also remove projects you're not using by specifying a local manifest, or even work from a compressed filesystem like btrfs with the right mount options, but I'm unsure of the performance impact.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…