If
- I have a local repo with
$REMOTE already configured - and a new
$BRANCH branch exists on the remote repo, which I did not select, but
Is it possible to get this branch and check it in the local tracking branch with the same name in one command ?
I can achieve the desired result in two teams with
git fetch $REMOTE $BRANCH git checkout $BRANCH
or (inspired by this answer to the question How to check the remote Git branch? ) with
git fetch $REMOTE $BRANCH:$BRANCH git branch --set-upstream-to=$BRANCH $BRANCH
das-g source share