开发者

How to create repository on BitBucket remotely?

开发者 https://www.devze.com 2023-01-05 08:56 出处:网络
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 AP

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

0

精彩评论

暂无评论...
验证码 换一张
取 消