This seems to work for me.
First mentioning some setup
# cd to root of source tree
repo start MyBranch # Create working branch for all projects
repo checkout MyBranch # switches all projects to use MyBranch
Time passes, fabulous edits made and committed (in MyBranch), working branch is clean. Now want upstream changes ...
# Current active branch is "MyBranch"
# The following sync -d as per repo docs:
# -d: switch specified projects back to the manifest revision.
# Helpful if the project is currently on a topic branch,
# but the manifest revision is temporarily needed.
# In other words, it automatically syncs default manifest's upstream
repo sync -d -j12
# Active branch may be "MyBranch" or possibly a detached head or whatever.
# So, if necessary, switch back to MyBranch
# - I usually do this just to make sure all projects are in MyBranch
# - NOTE: If a new project appears it won't have MyBranch
repo checkout MyBranch
# Now we're in MyBranch. Its "upstream" is our local master so sync it.
# - This is usually rather quick
repo sync
The "repo sync -d" may not be necessary but hasn't caused any problems as far as I have seen. Plus it pulls the master codeline locally to keep it in sync for handy diffs and such.
Perhaps "repo sync" from within MyBranch does that too. But I don't seem to get any updates when I omit the "repo sync -d" step and just do "repo sync" when MyBranch is checked out. (Although maybe my local setup is messed up somehow)
To summarize:
Option A: Might work
cd RootOfRepoSourceTree # wherever you have it
repo checkout MyBranch
repo sync
Option B: Works consistently for me
cd RootOfRepoSourceTree # wherever you have it
repo sync -d -j12
repo checkout MyBranch
repo sync