A branch in git is just a text file containing a commit Id. This is located in .git/refs/heads
. In your case there is a text file in .git/refs/heads/feature
called story-30
. Trying to create a branch called feature/story-30/Task-120
attempts to create sub folder in .git/refs/heads/feature
called story-30
, but this already exists as a text file, so the OS reports back to Git that it cannot create the directory. As a result, Git reports back to you that it cannot create the branch.
You will need to create a new branch with a different name.
git push: refs/heads/my/subbranch exists, cannot create is a similar question where this same error occurred when pushing a branch to another server, so be aware this can happen locally when creating a branch, and on the server when pushing a branch.