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

Importing repository with API?

Steven Fuentes September 1, 2021

I'm looking to create a copy of an existing repository using the bitbucket api.  I can do this in the gui using the "Import Repository" and create a new repository from an existing one, but don't see any method of doing this in the repository endpoint in the api.  Is this possible?

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 6, 2021

Hi Steven and welcome to the community.

I'm afraid that we don't have an API endpoint for importing a repository.

We have a feature request for this in our issue tracker:

If you'd be interested in that, I would suggest adding your vote to that ticket (by selecting the Vote for this issue link) as the number of votes helps the development team and product managers better understand the demand for new features. You are more than welcome to leave any feedback, and you can also add yourself as a watcher (by selecting the Start watching this issue link) if you'd like to get notified via email on updates. Implementation of new features is done as per our policy here and any updates will be posted in the feature request.

In the meantime, one thing I can suggest as a workaround is the following:

- Create a new repository in Bitbucket with the following endpoint: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D#post

- Take a mirror clone of the repo you want to import

- Push from that mirror clone to the newly created Bitbucket repo

Please feel free to let me know if you have any questions.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events