Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

switch between different android repo tags

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?

like image 561
Pavel P Avatar asked May 13 '13 15:05

Pavel P


1 Answers

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 subsequent repo sync (or repo 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.

like image 174
sfridman Avatar answered Oct 07 '22 15:10

sfridman