且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

AOSP回购同步花费的时间太长

更新时间:2023-11-30 19:39:40

AOSP 是一个数千兆字节的下载,因此您无能为力.但是,将-c/--current-branch选项传递给repo sync会使Repo告诉Git仅获取您真正需要的分支,而不是每个存储库的所有分支.对于像Gingerbread这样的旧版本,从理论上讲,这应该是非常有益的.但是,Repo使用通过HTTP下载的Git捆绑包为存储库播种,并且捆绑包文件不受-c选项的影响.使用--no-clone-bundle禁用捆绑文件.因此,以下Repo命令应产生最小的下载量:

AOSP is a multi-gigabyte download so there's not that much you can do. However, passing the -c/--current-branch option to repo sync causes Repo to tell Git to only fetch the branch you really need instead of all branches of each repository. With an old release like Gingerbread this should theoretically be quite beneficial. However, Repo seeds the repositories with Git bundles that it downloads via HTTP, and the bundle files aren't affected by the -c option. Using --no-clone-bundle disables the bundle files. Hence the following Repo command should yield the smallest download:

repo sync -c --no-clone-bundle

(请记住,Gingerbread发行已经有好几年了.在许多最新的硬件上都无法立即使用.)

(Keep in mind that Gingerbread is a several year old release. It won't work out of the box on a lot of recent hardware.)