Long answer:
You cannot specify the branch name (or SHA or something else) on the repo
, this will not work. That's why:
repo
is a script that processes a collection of repository projects (which are actually independent git). The list of projects is in .repo
git and contains a manifest file, which basically is a list of all git repositories, and they branch. -b
is only relevant to repo
git during repo init
.
Here is an example .repo/manifests/default.xml
:
<?xml version="1.0" encoding="UTF-8"?> <manifest> <remote fetch="git://address.com/" name="origin" review="review.address.com"/> <default remote="origin" revision="ics-something" sync-j="4"/> <manifest-server url="http://manifests.address.com:8000"/> <project name="platform/external/libxml2" path="external/libxml2" revision="ics-common"/> <project name="platform/external/zlib" path="external/zlib" revision="ics-common"/> <project name="platform/frameworks/base" path="frameworks/base" revision="ics-something"/> <project name="platform/packages/apps/Bluetooth" path="packages/apps/Bluetooth" revision="ics-common"/> </manifest>
So, the correct way to get repository sources for a particular assembly is to get its manifest.
Ie, manifest, which will contain SHA (or tags that are almost the same, if present) instead of branch names. This way, every git project in your repository will point to some commit, which was the most recent when the build was done:
<?xml version="1.0" encoding="UTF-8"?> <manifest> <remote fetch="git://address.com/" name="origin" review="review.address.com"/> <default remote="origin" revision="ics-something" sync-j="4"/> <manifest-server url="http://manifests.address.com:8000"/> <project name="platform/external/libxml2" path="external/libxml2" revision="refs/tags/android-4.0.4_r1.1"/> <project name="platform/external/zlib" path="external/zlib" revision="refs/tags/android-4.0.4_r1.1"/> <project name="platform/frameworks/base" path="frameworks/base" revision="ecb41a77411358d385e3fde5b4e98a5f3d9cfdd5"/> <project name="platform/packages/apps/Bluetooth" path="packages/apps/Bluetooth" revision="621bae79f1a250e443eb83d1f473c533bea493dc"/> </manifest>
As you can see, the only difference between the two manifests is the revision values โโof the git repository.
Short answer:
You need to get manifest_static.xml
specific assembly.
Or, if you just miss some git project, then you can create a local_manifest.xml
file in .repo
git, add the missing git there, and then repo sync
from the root of your repository. More information on using local_manifest.xml
here .