How to create repository on BitBucket remotely?
I want to create a repository fr开发者_运维问答om my local machine using hg commands on Bitbucket instead of creating a repo manually on Bitbucket. Is it possible?
I did the following using the REST API through curl command:
$>curl -k -X POST --user user:pass \
"https://api.bitbucket.org/1.0/repositories" -d "name=project_name"
I believe the only way to make a BitBucket repo is on BitBucket, either through their web interface, or their API.
This question has details of how to create an empty repo on BitBucket then push local content to it.
You can create a bitbucket repository using their API. I use this Python script to create my repositories, then edit the .hgrc, then push the repo.
I'm using following code to create repo on Bitbacket remotely from terminal:
curl -u 'USERNAME' https://api.bitbucket.org/1.0/repositories -d '{"name":"REPO"}'
where
USERNAME - your username on BitBucket
REPO - name of repository
精彩评论