After committing my latest work on a new branch branchname
to my local git repo on machine A, I pushed that work to my gitlab remote repo with
$ git push origin branchname
The master
branch was already in sync with the remote repo. All branches showed up on the remote repo on my gitlab list.
I later went to machine B. I first did a
$ git pull origin master
and master was updated, but my new branchname
didn't show up when I typed git branch
, nor did another branch that I new existed in the history tree. I went to this post and followed the directions from the first answer. Another 'git branch' still did not show my other branches. On a whim, I simply tried to do
$ git checkout branchname
and it was there and checked out fine. A git branch
command then showed master and branchname in my list of branches. I did the same thing with another branch, and it too then showed up in the branch list after a git branch
command.
Is this normal git behavior for such operations? The main thing I am wondering is if you pull or fetch from a remote repo to update a local repo that had to know previous knowledge of branches on the remote, why don't they show up during a git branch
command? And, why can I check them out when I couldn't see them after a git branch
?
This saga is similar to THIS one, but my branches were actually there and just NOT showing following git branch commands until I checked them out.