In order to be able to checkout between branches the way you did:
-you need to know ahead of time that the list of projects is the same
in your source and destination branches (which is very rarely the
-you need to know ahead of time that the branch name is the same in
all projects (which is also quite rare)
-you need to switch to a branch that makes sense (beware,
"gingerbread-release" isn't guaranteed to make any sense)
-you need to know that you won't be able to upload and that your local
state will be wiped the next time you sync
> You received this message because you are subscribed to the "Android Building" mailing list.
> To post to this group, send email to android-...@googlegroups.com
> To unsubscribe from this group, send email to
> For more options, visit this group at
Jean-Baptiste M. "JBQ" Queru
Software Engineer, Android Open-Source Project, Google.
Questions sent directly to me that have no reason for being private
will likely get ignored or forwarded to a public forum with no further
Here's how I do it. It allows switching between dissimilar branches, and
allows uploading the results.
Lets say you are on froyo, and want to check out gingerbread-release, as
repo init -b gingerbread-release
(answer the silly questions)
repo sync (not needed if your local copy is up to date, but is needed
the first time, even if you already "repo sync" before the "repo init")
repo start gingerbread-release --all
That last command creates a branch for you to work on. Any time in the
future you check out that branch, you will get something based on the
repo checkout gingerbread-release
You're good to go. If you want to upload anything to gerrit, you will
need to use "master" for your "repo init". Any time anything major
changes (such as now), you will also need to repeat the "repo start
master --all" command. You might need to erase the old master branch
before you do. repo prune might be your friends here.
If you made a change in a non-master branch, and you want to upload it,
just use git in the project itself to transfer your changes between the
branch and the master branch, and then use repo to upload them as usual.
Lingnu Open Source Consulting Ltd.
You can't just checkout in all projects, because (like I explained above):
-the list of projects changes from one branch to another, so the
notion of "all projects" can't be used to go across branches
-there's not a 1:1 mapping between names of manifests and names of
branches in individual projects.
As an extra trick, if you already have a client tracking one branch
and want a client tracking another branch:
create a new empty directory
run repo init in it (with the -u parameter)
copy the .repo/projects directory from your existing client into the new one.
That'll only download the projects you don't already have.
I know Google is paying for big fat machines to its developers, but some
of us consultants work on a budget and/or need to take our work machine
with us on a shoulder strap (actually, mine's a backpack, but the
argument still stands).
If you're planning to upload those changes to a server, you'll need to
repo start new branches after the switch if you want then to be
uploaded to the right server branch.