How to create repository on BitBucket remotely?

我只是一个虾纸丫 提交于 2019-12-14 03:39:55

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!