Switch between different Android repository tags

I need to download the src code of various Android tags. Each time it takes half an hour and gigs of space. Instead, I would rather switch to another tag. How can i do this?

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 is the correct way to switch / upgrade from android-4.0.4_r1.1 to android-4.2.2_r1?

+4
source share
2 answers

You can get tags with:

git fetch

git fetch --tags

And do a check:

git checkout tag_name

Also, if it takes more time to synchronize than a regular run below the command in this repo:

git gc

-1
source

As mentioned in the comments of the accepted answer, you can change the default version in manifest.xml. It has a snippet of repo help init :

Enable manifest branches

To switch to a different manifest branch, repo init -b otherbranch can be used in an existing client. However, since this only updates the manifest, a subsequent repo sync (or repo sync -d ) is needed to update the working directory files.

This will not load everything freshly, but will perform the necessary git operations to check the correct branch / tag in the projects. In fact, if you run it with --trace , you will see that it is a little more than just a git checkout .

NOTE. If you use this method, you must make sure that you provide the same parameters for the repo-init as for the previous call. In particular, if you provided the -g options, put them again or repo sync , now unnecessary directories in the new set of groups will be deleted.

+5
source

Source: https://habr.com/ru/post/1480521/


All Articles