How to download only a working directory of the AOSP source code without the entire repo history?

前端 未结 3 1082
时光说笑
时光说笑 2021-01-11 18:02

The size of the latest AOSP source code is rather large (around 30-35 Gb for the .repo directory and another 15 Gb or so for the working directory). Is there a way to downlo

3条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-11 18:47

    Since git version 2.19 (released in 2018), we can utilize git's --partial-clone flag via the repo tool like the following:

    repo init -u https://android.googlesource.com/platform/manifest -b master --partial-clone --clone-filter=blob:limit=10M
    

    For readers of this question and answer in 2020, be warned that the AOSP repositories have gotten bigger and the above command still results in around 73 gigabytes of source code and related files.

提交回复
热议问题