Not sure, what I am missing
That is exactly what Git 2.45 (Q2 2024), batch 8, addresses: when git refuses to create a branch because the proposed branch name is not a valid refname, an advice message is given to refer the user to exact naming rules.
See commit 8fbd903, commit 15cb037, commit 3ccc478, commit 95c987e, commit 8c5001c (05 Mar 2024) by Kristoffer Haugsbakk (LemmingAvalanche).
(Merged by Junio C Hamano -- gitster -- in commit b09a883, 15 Mar 2024)
branch: advise about ref syntax rules
Signed-off-by: Kristoffer Haugsbakk
git-branch(1) will error out if you give it a bad ref name.
But the user might not understand why or what part of the name is illegal.
The user might know that there are some limitations based on the loose ref format (filenames), but there are also further rules for easier integration with shell-based tools, pathname expansion, and playing well with reference name expressions.
The man page for git-check-ref-format(1) contains these rules.
Let's advise about it since that is not a command that you just happen upon.
Also make this advise configurable since you might not want to be reminded every time you make a little typo.
git config now includes in its man page:
refSyntax
Shown when the user provides an illegal ref name, to tell the user about the ref syntax documentation.
man git-check-ref-formatfor valid ref names.