I need to download src code of different android tags. Each time it takes half an hour and GIGS of space. Instead I'd prefer to switch to different tag. How can I do so?
cd android-4.0.4_r1.1
repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.4_r1.1
repo sync
cd ../android-4.2.2_r1
repo init -u https://android.googlesource.com/platform/manifest -b android-4.2.2_r1
repo sync
What's the proper way to switch/update from android-4.0.4_r1.1 to android-4.2.2_r1?
As mentioned in the comments of the accepted answer, you can change the default revision in manifest.xml. There's a snippet about it in repo help init
:
Switching Manifest Branches
To switch to another manifest branch,
repo init -b otherbranch
may be used in an existing client. However, as this only updates the manifest, a subsequentrepo sync
(orrepo sync -d
) is necessary to update the working directory files.
This won't download everything fresh, but will perform the necessary git operations to checkout the correct branch/tag across projects. Actually, if you run it with --trace
, you'll see it does a good bit more than just git checkout
.
NOTE: If you use this method you must make sure you supply the exact same parameters to repo init as you had for your previous invocation. Specifically, if you supplied -g
options, supply them again or repo sync
will remove directories now unnecessary in the new set of groups.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With