Class GHRepositoryForkBuilder

java.lang.Object
org.kohsuke.github.GHRepositoryForkBuilder

public class GHRepositoryForkBuilder extends Object
A builder pattern object for creating a fork of a repository.
See Also:
  • Method Details

    • defaultBranchOnly

      public GHRepositoryForkBuilder defaultBranchOnly(boolean defaultBranchOnly)
      Sets whether to fork only the default branch.
      Parameters:
      defaultBranchOnly - the default branch only
      Returns:
      the gh repository fork builder
    • organization

      public GHRepositoryForkBuilder organization(GHOrganization organization)
      Specifies the target organization for the fork.
      Parameters:
      organization - the organization
      Returns:
      the gh repository fork builder
    • name

      public GHRepositoryForkBuilder name(String name)
      Sets a custom name for the forked repository.
      Parameters:
      name - the desired repository name
      Returns:
      the builder
    • create

      public GHRepository create() throws IOException
      Creates the fork with the specified parameters.
      Returns:
      the gh repository
      Throws:
      IOException - the io exception