1. Bitbucket
  2. Public Issue Tracker
  3. master
  4. Issues

Issues

Issue #2380 open

Support for cloning a new repository? (Fork API endpoint) (BB-1098)

aleric
created an issue

Hi, I'd like to remotely create a new repository (by cloning another). Then I can spare bandwidth by pushing additional changes to it, for review by others. And after the review and merge into the main reository, I'd like to be able to remotely delete the repository again :).

So far I could not find how this is possible using the REST API.

Comments (19)

  1. Steve Streeting

    I'd like to add my vote for this feature.

    You very kindly just added the ability to see the list of repositories that the logged in account is following to the API, and I've just added support for that to my tool (SourceTree). However the next natural step is allowing you to create your own fork - I already support creating new repositories on BB.

    It's been a while since this was raised, is there any chance you'll be adding it soon now the following API is in?

    Thanks Steve

  2. Yarko Tymciurak

    I can imagine that Atlassian doesn't want to provide an API for this (for the potential to explode data consumption / usage due to errors or malicious exploitation).

    However - here is a concrete example of what would be useful, by way of a specific example from a UI element from github.com, and how it is being used (and what, at least where I am, people would want ... given the numbers who would prefer to use hg to git).

    Since bitbucket gives a repo choice, what would really be useful (the API for forking then becomes somewhat optional) would be an "Edit" button / option when viewing a file of any arbitrary repository. The action of that "Edit" button would be "fork this repository", so that you instantiate a fork-followed-by-edit on your fork.

    To see how this is useful, have a look, for example, at the following document from UMich (a sphinx-doc.org document, which is written using reStructuredText markup):

    https://khmer.readthedocs.org

    Note the yellow "edit this document" in the lower right. Click, and follow the top link (to the source for that particular page; works with any arbitrary page, linking back to the correct source page in the repository);

    NOTE: github.com has a UI element "Edit" - hover over it.

    NOW: rather than needing an API access to make a programmatic fork, it is up to a logged in user who would like to make an edit / correction.

    It has the effect of facilitating a process, and encouraging community participation.

    Since my particular (non-programmer) community would prefer using mercurial, a similar UI extension, with this very facilitating set of actions would be most useful.

    Much more than an API call to initiate a fork, I think this general "EDIT" on any given file, with such a common-sense action would be most useful.

    Thanks!

  3. Daniel Bryant

    +1 to this as well

    I'm currently working on the Adopt OpenJDK betterrev project and this feature would be really useful to us

    We would really like to be able to authenticate a user via OAuth, and then programmatically fork a subset of our public repositories into their account.

    Any advice/thoughts would be most appreciated!

  4. Michael H. Cox

    Please make this feature more flexible than Github's forking feature. When you request a fork of a repo, it defaults to creating that fork in your user account. Please allow the ability to specify where the forked repository should be created, e.g. in one of your organizations. Maybe have it default to your user account if not specified.

  5. Log in to comment