1

I want to create a branch on a number of remote repositories on Bitbucket, and I'm working on writing a script that can automate that. I have a list of ssh urls but I'm having trouble figuring out how to use that to create a remote branch. Because of the amount of repositories I'm working with, creating a local copy and pushing it to the remote repository is too time consuming and inefficient. Any help would be greatly appreciated.

Janet
  • 13
  • 3

1 Answers1

1

Try this REST API.

$ curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -vv -u '$USERNAME:$PASS' "https://bitbucket.org/branch/create" -s -d 'repository=$TEAMORUSER%2F$REPO&from_branch=master&branch_name=feature'
Sajib Khan
  • 22,878
  • 9
  • 63
  • 73