问题
I want to create a repository from my local machine using hg commands on Bitbucket instead of creating a repo manually on Bitbucket. Is it possible ?
Thanks in advance for your response.
回答1:
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.
回答2:
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"
回答3:
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.
回答4:
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
来源:https://stackoverflow.com/questions/3129165/how-to-create-repository-on-bitbucket-remotely