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.
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 – 2015-03-05T22:10:19.270
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 – 2015-03-07T04:51:03.347