I have a repo that has another remote upstream besides origin. I can do git checkout origin/master, but when I run git checkout upst
upstream
origin
git checkout origin/master
git checkout upst
In more concise way (I'm using git 2.28), you can say
git
git fetch upstream
and then
git checkout -b --guess
where the --guess flag checks if a branch corresponding to exists on any of the remotes and tracks the corresponding remote (docs here).
--guess