(如果它可以帮助某人)
我已经能够在 Stash/Bitbucket 服务器上设置分支模型(Stash v3.11.2,Bitbucket 4.8.3,我还没有测试其他版本):
$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
与
$CURL:curl -s -u USER:PASSWORD(以及其他一些选项,例如 -k --noproxy...)
$SERVER:服务器的 URL
$key:项目密钥
$slug: 存储库的 slug(~名字)
希望这会有所帮助...
干杯。