8

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?

Asclepius
  • 57,944
  • 17
  • 167
  • 143
Nitesh
  • 575
  • 2
  • 10
  • 27
  • This Bitbucket documentation page explains how to create a new repository remotely via http: https://confluence.atlassian.com/bitbucket/repository-resource-423626331.html#repositoryResource-POSTanewrepository –  Dec 31 '15 at 22:35

4 Answers4

8

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"
Mundi
  • 79,884
  • 17
  • 117
  • 140
Tate
  • 1,456
  • 1
  • 12
  • 13
6

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.

Community
  • 1
  • 1
Ned Batchelder
  • 364,293
  • 75
  • 561
  • 662
6

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.

Jason R. Coombs
  • 41,115
  • 10
  • 83
  • 93
0

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

arserbin3
  • 6,010
  • 8
  • 36
  • 52
Oleksandr
  • 41
  • 5