Create a branch in bitbucket cloud using curl

 Example:

curl -X POST \

-H "Authorization: Bearer <access_token>" \

-H "Content-Type: application/json" \

-d '{

      "name": "feature/mynewbranch",

      "target": {

          "hash": "master"

      }

    }' \

"https://api.bitbucket.org/2.0/repositories/gopiworkspace/gopirepo/refs/branches"

<access_token> is generated in the repository where you want to create the branch. https://bitbucket.org/gopiworkspace/gopirepo/admin/access-tokens 


Ref: https://community.atlassian.com/t5/Bitbucket-discussions/Create-branch-BitBucket-REST-API-Support/td-p/610927 

Comments

Popular posts from this blog

Programatically create layout builder section in Drupal

Code quality analysis of Drupal. Can I use Sonar?

Set up Drupal7 to Drupal8 migration in simple steps (using Drush)