I cannot create branches prefixed with release:
$ git checkout master && git pull
$ git checkout -b release/0.7.6
$ git push --set-upstream origin release/0.7.6
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
remote:
remote: Create pull request for release/0.7.6:
remote: https://bitbucket.org/xxx/xxx/pull-requests/new?source=release/0.7.6&t=1
remote:
To bitbucket.org:xxx/xxx.git
* [new branch] release/0.7.6 -> release/0.7.6
Branch 'release/0.7.6' set up to track remote branch 'release/0.7.6' from 'origin'.
error: update_ref failed for ref 'refs/remotes/origin/release/0.7.6': cannot lock ref 'refs/remotes/origin/release/0.7.6': 'refs/remotes/origin/release' exists; cannot create 'refs/remotes/origin/release/0.7.6'
When I look in the bitbucket interface, I can see the branch release/0.7.6 there, 0 commits before and 0 commits ahead of master.
Writing git fetch produces additional errors:
$ git fetch
error: cannot lock ref 'refs/remotes/origin/release/0.7.6': 'refs/remotes/origin/release' exists; cannot create 'refs/remotes/origin/release/0.7.6'
From bitbucket.org:xxx/xxx
! [new branch] release/0.7.6 -> origin/release/0.7.6 (unable to update local ref)
When I write git checkout and use tab completion, I indeed get the suggestion that release would be something I can check out, but again it fails when I try to do that:
$ git checkout release
fatal: cannot lock ref 'refs/heads/release': 'refs/heads/release/0.7.6' exists; cannot create 'refs/heads/release
I can see there is something called release and it is listed in red, but I cannot delete it:
$ git branch -a | grep remotes/origin/release
remotes/origin/release
$ git branch -D origin/release
error: branch 'origin/release' not found.
$ git branch -D release
error: branch 'release' not found.
$ git branch -D remotes/origin/release
error: branch 'remotes/origin/release' not found.
It can be checked out if I first remove my created release/0.7.6
$ git checkout release
Branch 'release' set up to track remote branch 'release' from 'origin'.
Switched to a new branch 'release'
What have I managed to do, and how can I solve it?
Update Our bitbucket branching model is traditional git flow:
The branch permissions have protected history and write on master, only allowed to merge with a PR.
I can't find any setting that would cause this.
