RESTfully creating a repository in BitBucket.org

RESTfully creating a repository in BitBucket.org

Submitted by Jitesh Doshi on Sun, 06/02/2013 - 12:01
Bitbucket Atlassian logo

Creating a  Git repository is simple, using the excellent BitBucket.org service. It can be a chore to go to the bitbucket website and manually creating new repositories every time, though. Since it is bitbucket, and Atlassian, they have exposed a very nice RESTful API on top their service offering. Below is an example of how to create a new repository from 'curl' command-line ...

 curl --user login:pass https://api.bitbucket.org/1.0/repositories/ --data name=REPO_NAME 

The above creates a 'public' repository. If you want a 'private' repository, then just add --data is_private='true'. Like this ...

 curl --user login:pass https://api.bitbucket.org/1.0/repositories/ --data name=REPO_NAME --data is_private=true 

(source: http://stackoverflow.com/questions/13788485/create-new-repo-on-bitbucket-from-git)

 

Jitesh Doshi

Profile picture for user Jitesh Doshi
Managing Partner & CTO
  • A seasoned technology entrepreneur and enthusiast
  • A regular speaker at industry conferences and universities
  • Host and organizer of technology user groups
  • Active in management of non-profit organizations serving the local community
  • Leader and contributor for multiple open-source projects
  • Expert in cloud, application integration, web and mobile technologies
  • Author of open-source projects, including on Drupal.org - Popular Tags and PRLP.
  • Developed several highly successful software platforms and frameworks for clients