減少git clone 下載的時間與空間

Reduce the download size of git repository

阿強
1 min readApr 23, 2020

在AOSP(Android Open Source Project)的專案中有蠻多的repositories需要fetch,而抓code就是一件很花時間的動作,平時抓某些大型github 開源專案也會花很長時間,AOSP中有一個kati

一般抓code的方法:

git clone https://github.com/google/kati.git

只抓深度為1的code:

git clone https://github.com/google/kati.git --depth 1

使用depth=1時,看git log會只有一筆並且標示grafted

depth=1

更多git clone詳細說明

git clone -h

--

--

阿強
阿強

Written by 阿強

一個喜歡研究新事物的軟體工程師

No responses yet