A repository with forty branches turns git branch into a very tall list. Git can print it in columns, the way ls does, and one setting makes that the default.
git config --global column.ui auto
The values are always, never and auto, and never is the default. With auto git uses columns only when the output goes to a terminal, so a script that reads the output of git branch still gets one name per line.
Layout can be added to the same value. The manual lists column (fill columns before rows, the default), row (rows before columns) and plain (one column), plus dense for columns of unequal width that use less space:
git config --global column.ui "auto,row,dense"
If you only want it once, git branch --column does that without touching the config, and --no-column turns it off again.
Caveat: columns make long branch names harder to read, and a name that is cut off or wrapped is easy to copy wrongly. When I want to pick a branch for a command, I would still use a one-per-line view. This setting is for browsing.
Further reading: git config, column.ui (Git documentation)
Going deeper: Guide: advanced tmux, a config that grows with you, formats, layouts and more