Skip to content

Instantly share code, notes, and snippets.

@jieyu
Last active December 11, 2015 05:29
Show Gist options
  • Save jieyu/4552815 to your computer and use it in GitHub Desktop.
Save jieyu/4552815 to your computer and use it in GitHub Desktop.
How to branch a topic from a given version of Android source code.

Branch a topic using repo in Android

This document is based on the code of android-4.1.1_r6 (Jelly Bean).

First, download the source code tree using repo tool:

# mkdir android-4.1.1_r6.1
# cd android-4.1.1_r6.1
# repo init -u https://android.googlesource.com/platform/manifest -b android-4.1.1_r6.1
# repo sync

Then, modify .repo/manifest.xml if you want to include your own git based projects (or other android related projects that are not included in the source code):

<project path="kernel/goldfish" name="kernel/goldfish" revision="android-goldfish-2.6.29" />

After that, do a sync again for the newly added project:

# repo sync kernel/goldfish

Finally, branch a topic for the projects you want to modify:

# repo start mybranch kernel/goldfish
# repo start mybranch libcore
...
# repo branch
*  mybranch               | in: build/goldfish, libcore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment