git how to checkout upstream branch code example Example: checkout remote branch git fetch origin git checkout –track origin/xyz