I don't recall seeing anything in git that involves putting the branch name on the filesystem. Not even poking around in the .git directory. What are you seeing?
So, every branch is represented by a file in .git/refs; you’ll find, for example, .git/refs/heads/master alongside any other local branches you’ve created.
There’s an analogous tree for remote branches!