需要将 android AOSP 代码重置为 Lollipop

Need to reset android AOSP code to Lollipop

我已经下载了Android AOSP的当前主控Android 6.0源代码。

有没有办法使用 repo 将 master 设置为 Android 5.1,以便相应地设置所有 git 个存储库?

注意:我希望无需再次下载即可执行此操作。

引自source.android.com

To check out a branch other than "master", specify it with -b. For a list of branches, see Source Code Tags and Builds.

$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1

编辑

Note: I wish to do this without downloading again.

你可以试试:

repo init -b <manifest-branch>
repo sync -j8

编辑 2

I want to know if there is way to do it without downloading. The sync would download from google servers.

documentationsync命令说的真清楚:

Downloads new changes and updates the working files in your local environment. If you run repo sync without any arguments, it will synchronize the files for all the projects.

When you run repo sync, this is what happens:

  • If the project has never been synchronized, then repo sync is equivalent to git clone. All branches in the remote repository are copied to the local project directory.

  • If the project has already been synchronized once, then repo sync is equivalent to:

    git remote update 
    git rebase origin/<BRANCH>
    

    where is the currently checked-out branch in the local project directory. If the local branch is not tracking a branch in the remote repository, then no synchronization will occur for the project.

  • If the git rebase operation results in merge conflicts, you will need to use the normal Git commands (for example, git rebase --continue) to resolve the conflicts.

因为您已经同步了项目,所以 sync 命令等同于 rebase