repo is a python script that manages cyanogenmod source code download.

to download cm-10.1 branch, repo command is,

cd ~/cm-10.1

repo init -u https://github.com/CyanogenMod/android.git -b cm-10.1

cd ~/cm-11

then we can use --reference option to download cm-11 source code like

repo init --reference=~/cm-10.1 -u https://github.com/CyanogenMod/android.git -b cm-11.0

but, that downloads the delta data into cm-11 directory.

I want to download all the cyanogenmod branches in single directory and build as required. How can i do this?

| improve this question | | | | |
  • The branches need to stay separate. That's why they're separated into different branches in the first place: that way files can be changed without affecting the files in other branches. Why are you trying to download them all into the same directory? – hololeap Mar 5 '15 at 22:10
  • to download the 2nd branch i use --reference option which is path sensitive. And to download further branches, multiple references cannot be set which means i have to download lot more data which i might already have in different branches.. – d6cbe4 Mar 7 '15 at 4:51

Since you are using the same URL for all the branches, you can download them to a single folder, and still they are kept separate.

You can download multiple branches of project files into a single .repo folder in a single working directory. This saves disk space and eliminates hurdles like path sensitive repo --reference , inability to use multiple references.

To download all branches into same .repo folder, do

repo init -u https://github.com/CyanogenMod/android.git -b cm-10.1
repo sync
repo init -b cm-10.2
repo sync
repo init -b cm-11.0
repo sync

and the list goes..
This downloads all the branches to the single .repo folder in a single working directory. When initializing a second branch, we donot provide the -u url option because we are reusing a different branch from local repo.

After repo sync the working directory contains the last initialized branch and this is completely harmless. We are only concerned about the working directory, not the contents of .repo folder. The branches still stay separate.

You may occasionally use repo forall -c git gc to pack all loose objects into pack files.

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.