SpinSpire logo

RESTfully creating a repository in BitBucket.org

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)

 


tags: Knowledge Base git api version control