This question already has an answer here:
The remote repo has a branch which doesn't exist on the local repo. I need to fetch it and start working with it without merging it with any other branches that I have. How can I do it?
It's not really an anonymous branch. After all you called it something. It is a remote tracking branch actually.
After checking out the remote branch with git checkout <remote>/<branch> I am on an unnamed, "anonymous", branch, I guess.
After checking our remote/branch you are in detached head. This is not generally speaking useful
That does most of the job, but the resulting local branch is not tracking the remote-tracking branch. In general, the way to do this is git fetch <remote> followed by git checkout <branch>. I'll add an answer.
how can I checkout to a branch that doesn't exist localy yet?