Create Branches with forward slashes
I recently upgraded from Gitlab-CE version 14 to 17, was running some tests and came upon this issue.
If you use the command line from VSCode or PowerShell to create a new branch with slashes on the name, it will return error 404 when you try to access the new branch.
However, when you run git branch -a
or git check-ref-format --branch feature/NewFeature
or git rev-parse --symbolic-full-name HEAD
everything seems to be OK
When you create a branch manually, using the Web UI, it works correctly
Steps to reproduce
- Install Gitlab CE 17.1.1 on RHEL 9 (
yum install gitlab-ce
) - Log in with default user/password
- Create a public project manually on the default user namespace
- Clone the project using VSCode on a Windows Laptop
- Create a new branch with
git checkout -b feature/NewFeature
- Publish the new branch and try to access from the Gitlab Page
- It will return Error 404
- Create a new Branch using the Web UI (http://mygitlab.com/myUser/my-new-test-project/-/branches/new)
- It will work, even if the branch has forward slash (‘/’) on the name is created using the Web UI
Linux
The same happened when used git from command line on the Linux that runs the Gitlab Instance using git checkout -b feature/MyLinuxFeature
and git push --set-upstream origin feature/MyLinuxFeature
. It creates a branch, but returns Error 404 when you try to access from the Web UI
VSCode
When VSCode is used, by choosing the Create New Branch option:
The same problem happens, the branch is created, but Web UI returns error 404
Another Issue
Another issue is if the name of the branch starts with Capital Letter, example: ‘Feature/NewTest’. When you commit and publish using the VSCode GUI, it will create a branch named ‘feature/NewTest’ and not the Capital Letter and a merge request will not find it. A solution is to use command lines and not the VSCode GUI.
Configuration
Public Project with a fresh Gitlab Install on a RHEL 9 OS
Versions
Please select whether options apply, and add the version information.
- Self-managed
- GitLab.com SaaS
Versions
- GitLab (Web:
/help
or self-managed system information):
Temp Solution
Create branches on the Web UI and checkout from VSCode GUI, using the command lines
Edit:
Our current temp solution is to run Docker on RHEL, since Gitlab is not working properly when using RHEL OS for Enterprise. And Docker that runs under Ubuntu, running on a RHEL system, is working properly…