Do you mean "upstream" and "origin" branch names or #git remotes?
Discussion
I think the author want to dynamically set remote=upstream (for the main branch), if remote exists. Otherwise set remote=origin.
I don't it's possible without writing some bash+git aliases :\