Required formatting for branch name not allowed
See original GitHub issueDescription
The GitHub desktop app currently helps automatically formats the branch name with some variation of kebab-case. However, this is proving a little bit too strict for my company’s workflow. We have some automatic actions that run when a name branch is suffixed with --preview
. The desktop app automatically replaces multiple dashes with a single dash, so something like branch-name--preview
becomes branch-name-preview
.
I would very much appreciate it if the app allowed for a little bit more freedom with how users name their branches.
Version
GitHub Desktop version: 10.0.10
OS version: MacOS 10.13.1
Steps to Reproduce
- Branch -> New Branch
- Name a branch with–multiple–dashes—
- The branch name will be reformatted to only allow one dash between words.
Expected behavior: More flexible naming conventions are allowed
Actual behavior: Strict kebab-case is applied
Reproduces how often: Always
Logs
Additional Information
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:11 (7 by maintainers)
Top Results From Across the Web
Which characters are illegal within a branch name?
Naming rules for refname: Git imposes the following rules on how references are named: They can include slash / for hierarchical (directory) grouping, ......
Read more >Valid Branch Names (#38817) · Issues - GitLab.org
GitLab let's you create non valid Git branch names. ... think the problem is only with dashes as the first character but I...
Read more >Legal Git branch names · wincent.com
Overview. A Git branch name can not: Have a path component that begins with . Have a double dot .. Have an ASCII...
Read more >Git - git-check-ref-format Documentation - Git SCM
This enforces the presence of a category like heads/ , tags/ etc. but the actual names are not restricted. If the --allow-onelevel option...
Read more >Git Branch Naming Rules and Conventions - YouTube
In Git we have a fair amount of freedom in how we name our branches. But there are some conventions and, most importantly,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ofek @joshaber I thought was running into the issue of not being able to create a ‘feature/feature-name’ type of branch and found this issue. However it looks like maybe I just ran into a UX bug. When I type ‘feature/’ the app shows a validation error instantly and I thought that no slashes were allowed. Maybe only show the validation error on submission so that users don’t think that branch names with forwards slashes in the middle of them are not allowed. Or maybe it is just me 😃
As suggested by @iAmWillShepherd, I opened a new enhancement issue for this “UX bug” you mentioned here as I also ran into this and was confused: Modify warning about forward slashes in branch name