Details
-
Suggestion
-
Resolution: Won't Fix
Description
Unable to create a branch with branch types if its prefix is occupied
Summary
Due to Git spec, it's unable to create a branch if its prefix is preoccupied as other branch's name and vice versa.
This also possibly happens to branching model.
Steps to Reproduce
- Create a branch named "feature"
- Enable "Feature" in branching model configuration
Expected Results
The error message should clarify why branch creation fails like below or guide how to apply the workaround.
fatal: cannot lock ref 'refs/heads/release/20181119': 'refs/heads/release' exists; cannot create 'refs/heads/release/20181119'
Actual Results
The below error message is shown:
We couldn't create a branch
If this keeps happening, contact support.
Notes
The error can occur the other way round:
- Enable "Release" in branching model configuration
- Create a branch prefixed "release/"
- Try creating a branch named "release"
In this case, the branch creation page better to make users unable to specify reserved names (feature, bugfix, hotfix, release).
Workaround
Rename or delete the pre-existing branch which blocks prefix.