Feature Request: Enforce lower-case branch names #20518
Replies: 2 comments
-
I hate that this feature isn't getting traction. This continues to be a problem across multiple git service implementations like BitBucket and GitHub. Seriously, this needs a long term fix. |
Beta Was this translation helpful? Give feedback.
-
I found a hack for enforcing lower-case branch names with the Github Ruleset feature. It's not optimal but may help someone save some time until github solves the branch name capitailzation issues. The magic is to add
Limits: The current regex suggestion is for ascii characters. Extending with other character sets is possible, but not needed for me. |
Beta Was this translation helpful? Give feedback.
-
As you might know git has a thing where branches are Case Sensitive. When the branches are checked out on a case-insensitive file-system such as Windows this may lead to problems.
Read for instance this stackoverflow issue: https://stackoverflow.com/questions/55051729/github-branches-case-sensitivity-issue
Preventing these kinds of branches by forcing a repository to not accept branches with upper-case names would be a nice way for these kinds of issues to not appear. A nice error message when pushing in the same way as when pushing to a protected branch, could make this issue visible and avoidable.
The problem I have is that sometimes someone writes
Feature/MyFeature
and someone else writesfeature/their-feature
. This makes for instance VS code checkout their feature asFeature/their-feature
(Note the capital F). When commiting back to that branch , and running "sync" in VS code that will create a new branch on github:Feature/their-feature
. Switching between these branches get troublesome very fast, as seen in the stack overflow issue.I would like to fix this with a repository setting in github, as I do not think that git will resolve this issue any time soon.
Using a branch name pattern will not work, as it is case-insensitive.
Beta Was this translation helpful? Give feedback.
All reactions