Search code examples
gitandroid-sourcerepo

How to change repo branch/tag after repo init url -b TAG?


I did

TAG_NAME=RQ1A.210105.003.2021.01.05.03
mkdir grapheneos-$TAG_NAME
cd grapheneos-$TAG_NAME
repo init -u https://github.com/GrapheneOs/platform_manifest.git -b refs/tags/$TAG_NAME

and compiled everything. Actually, it was not GrapheneOS profile but my own profile which has a fork of it. Then, I changed some things on the xml on the fork. Is there a way I can point to the new TAG without having to delete all the repo and doing repo init again? I already spent some hours compiling everything and didnt want to delete it.


Solution

  • By the new TAG, if you mean the one specified in repo init after -b, you could just run repo init -u https://github.com/GrapheneOs/platform_manifest.git -b $NEW_TAG_NAME and repo sync to update the repositories.

    Which repositories are downloaded and which revision is checked out are decided by the manifest. So if you want to use a specific manifest, you could also simply copy that manifest to somewhere and run repo sync -m $path. Here $path could be the absolute path to the manifest or its relative path in .repo/manifests if it's been placed under .repo/manifests.