Max length of git branch name
git, github
Solution
The 'File name too long' is indeed an error coming from your system. It is not a restriction in Git. I don't think there's a way of testing the maximum branch name lengths of other systems, like GitHub's, without experimenting - although I don't see why you would want to know...
.
Source: the error mentioned is thrown on line 291 of `branch.c`. "File name too long" is the standard description for the ENAMETOOLONG error.
Problem
I want to understand what is maximum allowed size of a git branch name. I am trying to create some long names (as an experiment) so a name with 370 characters was valid, but 380 characters gave me `fatal: Failed to lock ref for update: File name too long` So the questions are: what is the maximum number of characters that can be in git branch name? Does it depend on the system? Is it possible to create long branch name in a repository that will be rejected on remote repository (i.e. Github)?