AOSP Clone到一半的git斷線如何續傳?


先進入斷線要恢復的專案的.git目錄下
git fetch
git checkout FETCH_HEAD

例如下載AOSP的檔案都很大,外加網路不穩,導致repo常常會需要重新來過
假如我在下面這裡斷掉,也可以應用git來續傳
: export GIT_DIR=/home/yhchiu/aosp/.repo/projects/prebuilts/sdk.git
: git fetch aosp --tags +refs/heads/*:refs/remotes/aosp/* +refs/tags/android-4.4.2_r2.0.1:refs/tags/android-4.4.2_r2.0.1
remote: Sending approximately 1.92 GiB ...
remote: Counting objects: 75, done
remote: Finding sources: 100% (75/75)
^CTerminatedjects:  69% (6553/9445), 731.14 MiB | 1.22 MiB/s  

cd ~/aosp/.repo/projects/prebuilts/sdk.git
git fetch aosp --tags +refs/heads/*:refs/remotes/aosp/* +refs/tags/android-4.4.2_r2.0.1:refs/tags/android-4.4.2_r2.0.1
雖然說可以續傳,不過進度還是會減少

留言