简体   繁体   English

用repo下载Android源代码

[英]Downloading Android source with repo

When I give these commands then the 2.3.7 branch gets initialized in current directory and source gets downloaded. 当我给出这些命令时,2.3.7分支在当前目录中被初始化并且源被下载。

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

repo sync

Thereafter if I give following command what exactly happens 如果我给出以下命令究竟发生了什么

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

or 要么

repo init -u https://android.googlesource.com/platform/manifest 

My Questions 我的问题

  1. Will my earlier branch be deleted which I have downloaded with great difficulty? 我的早期分支是否会被删除,我很难下载? Cant I have multiple branches existing simultaneously? 我不能同时存在多个分支吗?

  2. If I can have more than one branch then how to access them? 如果我可以拥有多个分支,那么如何访问它们? I dont see any directory called 2.3.7 or 4.0.1. 我没有看到任何名为2.3.7或4.0.1的目录。

  3. The repo directory structure is very confusing. repo目录结构非常混乱。 Can anybody guide? 任何人都可以指导吗?

You should start a new repo branch within the same source code branch 您应该在同一源代码分支中启动一个新的repo分支

 repo start BRANCH_NAME [PROJECT_LIST]

Also refer to the following book on how to switch and make use to features in git 另请参阅以下有关如何切换和使用git中的功能的书

Look at section on branching and merging . 看看有关分支和合并的部分 Create branch using repo and then git commands to move around 使用repo创建分支,然后使用git命令移动

I see that you want to sync a new branch while using the files downloaded at previous sync to save download time. 我发现您希望在使用先前同步下载的文件时同步新分支以节省下载时间。

  1. create a new directory 创建一个新目录
  2. copy the .repo file (hidden) from the old branch_folder (gingerbread in your case) to a new directory .repo文件(隐藏)从old branch_folder (在您的情况下为姜饼)复制到新目录
  3. cd into that directory 进入该目录

Finally you can do: 最后你可以这样做:

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

You should do a repo init in a different directory. 您应该在另一个目录中执行repo init。 repo init clones the git structure specified by the manifest file eg repo init克隆清单文件指定的git结构,例如

android/gingerbread/repo init

android/eclair/repo init

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM