Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

create a repo on Stash using cli

satboy78 July 15, 2016

Hi,

I took a look at Atlassian Stash REST Plugin resources - https://developer.atlassian.com/static/rest/stash/3.11.3/stash-rest.html - and it seems there is no command to create a repo by CLI: is it correct? is there another way to create a repo by command line?

Thanks a lot.

Best regards.

Matteo

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Jeff Thomas
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 15, 2016

POSTing to the /rest/api/1.0/projects/{projectKey}/repos endpoint will create a repository. For example:

curl -u <ADMIN> -X POST -H "Content-Type: application/json" -H "Accept: application/json" -d '{ "name": "rest-api" }' "https://stash.company.com/rest/api/1.0/projects/<PROJECT>/repos"

This will create a repository called rest-api in the <PROJECT> project.

satboy78 July 17, 2016

Thanks a lot Jeff!

0 votes
Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 16, 2016

You can also use createRepository from Bitbucket Command Line Interface (CLI). In this case, it would not add value over Jeff's answer unless you had other similar automation you wanted to take advantage of.

TAGS
AUG Leaders

Atlassian Community Events