Switch to a specific version of Android source code
I'm playing with the Android source开发者_Python百科 code and I would like to switch to 2.3.3 and make some modifications from there. How do I do this?
More specifically, I made a git clone of the Launcher2 project and would like to switch it to the android-2.3.3_r1a
tag. I tried,
git checkout android-2.3.3_r1a
but Git seems to think I'm trying to make a new branch instead.
I also tried
git branch -r
which listed
origin/HEAD -> origin/master
origin/eclair
origin/eclair-passion-release
origin/eclair-release
origin/eclair-sholes-release
origin/eclair-sholes-release2
origin/froyo
origin/froyo-plus-aosp
origin/froyo-release
origin/gingerbread
origin/gingerbread-release
origin/master
origin/tools_r7
origin/tools_r8
origin/tools_r9
and then
git checkout origin/froyo
but nothing seems to happen (files are unchanged) and
git branch
still outputs "* (no branch)".
all you need to do is git checkout -t origin/android-2.3.3_r1a
. This will give you the branch you want and track the remote one.
Try:
git checkout -b android-2.3.3_r1a origin/android-2.3.3_r1a
Or:
git branch android-2.3.3_r1a origin/android-2.3.3_r1a
git checkout android-2.3.3_r1a
精彩评论