Switching branch with repo for Android Source code | Akshay Deo Switching branch with repo for Android Source code · Akshay Deo

Switching branch with repo for Android Source code


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>

  1. git reset command for removing changes that you have made
$ repo forall -c git reset --hard
  1. 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
  1. Sync repo
$ repo sync
  1. It’s applicable for all combinations

And magic happens :).
Hope you will find this useful. Cheers and happy coding m/.


powered by TinyLetter



Comments