Switching branch with repo for Android Source code29 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 <pre>$ repo forall -c git reset –hard</pre>
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 <pre>$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1</pre>
Sync repo <pre>$ repo sync</pre>
It’s applicable for all combinations
And magic happens :).
Hope you will find this useful. Cheers and happy coding m/.