lunohodov lunohodov - 4 months ago 15
Git Question

Which characters are illegal within a branch name?

Which characters are illegal within a branch name?

Answer

A branch name can not:

  • Have a path component that begins with "."
  • Have a double dot ".."
  • Have an ASCII control character, "~", "^", ":" or SP, anywhere
  • End with a "/"
  • End with ".lock"
  • Contain a "\" (backslash

Thanks to Jakub Narębski: the man page for git check-ref-format has more details.

Comments