Switching branch with repo for Android Source code
29 May 2012
I find working with repo as difficult as working with Android source code. We faced a lot of trouble while working with different versions of Android Source code. So I googled for repo command help but didnt find much help. So I experimented a bit and found a good way of switching branch.</br></br>
- git reset command for removing changes that you have made
$ repo forall -c git reset --hard
- then initialize repo with new branch.Suppose you have checked out version 4.0.4_r1.2 and you want to revert to 4.0.1_r1 (which was my case actually :P) then
$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1
- Sync repo
$ repo sync
- Itβs applicable for all combinations
And magic happens :).
Hope you will find this useful. Cheers and happy coding m/.