简体   繁体   中英

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.

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.

  3. The repo directory structure is very confusing. Can anybody guide?

You should start a new repo branch within the same source code branch

 repo start BRANCH_NAME [PROJECT_LIST]

Also refer to the following book on how to switch and make use to features in git

Look at section on branching and merging . Create branch using repo and then git commands to move around

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
  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 clones the git structure specified by the manifest file eg

android/gingerbread/repo init

android/eclair/repo init

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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