Cannot reuse an old branch prefix as a branch name (BB-11256)
Some time ago I pushed a branch called 'dev/some_feature' to a Bitbucket repository. Now I've decided that I want to group my feature branches not with a 'dev/' prefix but with 'feature/', and I want to use a branch called 'dev' as the integration branch with all finished changes.
So I merged and deleted all 'dev/*' branches on Bitbucket and locally. I then created a local 'dev' branch (branching off of the 'master' branch). Now if I try to push this branch to Bitbucket (remote 'origin'), I get the following error:
! [remote rejected] dev -> dev (failed to write) error: failed to push some refs to 'https://firstname.lastname@example.org/xxx/xxx.git'
My guess is that, although all 'dev/*' branches have been deleted, there's still a 'dev' folder in .git/refs/heads. I am not aware of any method by which to actively remove this folder, either thru the web interface or with any git-remote command. I don't know how often git-gc runs on Bitbucket and if it will fix this issue. If I use the web interface to create a new branch off of 'master' directly in the Bitbucket repo, the error message says 'Invalid branch name'.
It would be nice if Bitbucket could see that the 'dev' branch name is in fact available.