(If it can help someone)
I've been able to setupo the branching model on Stash/Bitbucket servers (Stash v3.11.2, Bitbucket 4.8.3, I haven't tested other versions) :
$CURL -X PUT -H 'Content-Type: application/json' \
-d '{"development":{"refId":"refs/heads/develop", "useDefault":false}, \
"production":{"refId":"refs/heads/master","useDefault":false}, \
"types":[ \
{"id":"BUGFIX","displayName":"Bugfix","enabled":true,"prefix":"bugfix/"}, \
{"id":"FEATURE","displayName":"Feature","enabled":true,"prefix":"feature/"}, \
{"id":"HOTFIX","displayName":"Hotfix","enabled":true,"prefix":"hotfixme/"}, \
{"id":"RELEASE","displayName":"Release","enabled":true,"prefix":"release/"} \
]}' \
${SERVER}/rest/branch-utils/1.0/projects/$key/repos/$slug/branchmodel/configuration
with
$CURL
: curl -s -u USER:PASSWORD
(and some others options like -k
--noproxy
...)
$SERVER
: the URL to the server
$key
: the project key
$slug
: the slug (~ the name) of the repository
Hope this helps...
Cheers.