repo init a particular commit

renzoe picture renzoe · May 30, 2012 · Viewed 16k times · Source

Im building the Cyanogenmod 9 (Android ICS) system for a Nexus S phone (samsung crespo). The problem is that if I do:

repo init -u git://github.com/CyanogenMod/android.git -b ics  

The repo inits to the latest commit of ICS, in which the manifest does not include some device/samsung/ projects I need (specifically https://github.com/CyanogenMod/android_device_samsung_crespo).

How do I repo init to a particular commit? In my case I want the last commit using the google android-4.0.3_r1 branch. Is this one:

If I do

repo init -u git://github.com/CyanogenMod/android.git -b commit-hash

Does not work, seems that repo init -b only support the HEAD of a branch.

Thanks in Advance.

Answer

Renaud Mathieu picture Renaud Mathieu · Oct 28, 2013

I figured it out. If your have a tag in a manifest file (version.xml for example). You can repo init to a specific tag with the following command:

repo init -u <addres> -b refs/tags/<tagname> -m version.xml