I have a question about switching branches using repo. I know that I can checkout a branch like this:
$ repo init ... -b foo
$ repo sync
My understanding is that this will checkout the foo branch of the manifest repository, and then check out the git projects as described in the manifest.
I also understand that I can switch branches like this:
$ repo init ... -b bar
$ repo sync -d
My question is, can I switch branches without doing repo init & repo sync each time, and what are the implications of doing so?
Let me illustrate with an example:
$ repo init ... -b foo
$ repo sync -d
$ repo start foo-mytopic proj1 proj2
... make some commits ...
$ repo upload -t
$ repo init ... -b bar
$ repo sync -d
$ repo start bar-topic proj1 proj3
$ repo upload -t
$ cd proj1
$ git checkout foo-mytopic # IS THIS ALLOWED?
I've tried this before, and it seems to work, but it's a bit strange because I have now checked out code that was in the foo manifest, but my current manifest branch is bar. What are the implications of being on a different branch than that described in the manifest?
Note: I've read this, and I think my question is different. I know how to switch branches. I'm interested in the implications of being on a different branch than the one described in the current manifest and how this might affect my workflow.