1

I have a base repository in Bitbucket project and I need to create new repository based on this base repository using REST API. The new repository has to contain all the files from the base repository.

How can I do do it?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
snir.tur
  • 461
  • 3
  • 7
  • 14

1 Answers1

-1

The way to do it is by forking the repository this way:

  • Using Http POST
  • URI: http://{IP}:{PORT}/rest/api/1.0/projects/{PROJECT_NAME}/repos/{REPO_NAME}/
  • Authorization - use BasicAuth
  • Content-Type - "application/json"
  • Body: { "slug": "URL_FRIENDLY_NAME", "name": "NEW_REPO_NAME", "project": { "key": "PROJECT_NAME" } }
snir.tur
  • 461
  • 3
  • 7
  • 14