A colleague created a new branch in our repo in Github, but I cannot seem to use checkout to get it, and when I do a git branch -a
(using Git Bash, Windows 10) it is not listed among the branches. Yet in my Github account behold, there it is under Active branches: 36_assistapi.
I tried several variations on the following command but get the same output.
$ git checkout origin/36_assistapi
error: pathspec 'origin/36_assistapi' did not match any file(s) known to git
I also tried git checkout 36_assistapi
and git checkout 36_assistapi
Surely we've omitted something simple:
CodePudding user response:
You first need to fetch the repo so you get a local copy of this new branch:
git fetch origin
Once you do this, you should be able to check out to it:
git checkout 36_assistapi