Class RepositoryForkRequest

java.lang.Object
com.atlassian.bitbucket.repository.AbstractRepositoryRequest
com.atlassian.bitbucket.repository.RepositoryForkRequest

public class RepositoryForkRequest extends AbstractRepositoryRequest
Defines the properties that can be set when forking a Repository. To reduce backwards compatibility issues as new properties are added over time, instances of this class may only be created using its RepositoryForkRequest.Builder.

The following property is required:

The following properties, if not specified, will have defaults applied: The fork's slug, which is used in URLs (both for the browser and when cloning), will be generated from the provided AbstractRepositoryRequest.getName(). Both the name and the generated slug must be unique within the project or the fork cannot be created.
See Also:
  • Method Details

    • getDefaultBranch

      @Nullable public String getDefaultBranch()
      Retrieves the default branch name that should be set on the newly-created fork. If no default branch name is specified, the parent's default branch is retained.
      Returns:
      the default branch name, which may be null to use the parent's
      Since:
      7.5
    • getParent

      @Nonnull public Repository getParent()
      Retrieves the repository to be forked. This will become the origin of the new fork.
      Returns:
      the repository to be forked
    • getProject

      @Nullable public Project getProject()
      Retrieves the project in which the fork should be created, or null to create the fork in the current user's personal project.
      Returns:
      the destination repository, or null to use the current user's personal project