Interface CloneCommand

  • All Superinterfaces:
    GitCommand

    public interface CloneCommand
    extends GitCommand
    Command to clone a repository. This command behaves differently from CLI clone command, it never actually checks out into the workspace.
    • Method Detail

      • repositoryName

        CloneCommand repositoryName​(String name)
        Name of the remote, such as 'origin' (which is the default).
        Parameters:
        name - a String object.
        Returns:
        a CloneCommand object.
      • shallow

        CloneCommand shallow​(boolean shallow)
        Only clone the most recent history, not preceding history. Depth of the shallow clone is controlled by the #depth method.
        Parameters:
        shallow - boolean controlling whether the clone is shallow
        Returns:
        a CloneCommand object.
        Since:
        2.5.0
      • shared

        @Deprecated
        CloneCommand shared()
        Deprecated.
        When the repository to clone is on the local machine, instead of using hard links, automatically setup .git/objects/info/alternates to share the objects with the source repository
        Returns:
        a CloneCommand object.
      • shared

        CloneCommand shared​(boolean shared)
        When the repository to clone is on the local machine, instead of using hard links, automatically setup .git/objects/info/alternates to share the objects with the source repository
        Parameters:
        shared - boolean controlling whether the clone is shared
        Returns:
        a CloneCommand object.
        Since:
        2.5.0
      • noCheckout

        @Deprecated
        CloneCommand noCheckout()
        Deprecated.
        When we just need to clone repository without populating the workspace (for instance when sparse checkouts are used). This parameter does not do anything, a checkout will never be performed.
        Returns:
        a CloneCommand object.
      • tags

        CloneCommand tags​(boolean tags)
        Boolean which allows caller to request that tags and their references are not fetched. Default is to fetch tags when cloning.
        Parameters:
        tags - boolean controlling whether tags are fetched
        Returns:
        a CloneCommand object.
      • refspecs

        CloneCommand refspecs​(List<org.eclipse.jgit.transport.RefSpec> refspecs)
        List of refspecs to be retrieved by the fetch.
        Parameters:
        refspecs - refspecs defining the references to be fetched
        Returns:
        a CloneCommand object.
      • depth

        CloneCommand depth​(Integer depth)
        When shallow cloning, allow for a depth to be set in cases where you need more than the immediate last commit. Has no effect if shallow is set to false (default).
        Parameters:
        depth - number of revisions to be included in shallow clone
        Returns:
        a CloneCommand object.