Interface GitScm

All Superinterfaces:
com.atlassian.bitbucket.scm.Scm

public interface GitScm extends com.atlassian.bitbucket.scm.Scm
Provides functionality for interacting with Git repositories, exposing factories which can be used to retrieve ready-built commands for performing well-known operations as well as a builder factory which can be used to assemble custom commands.

Where possible, plugin developers are strongly encouraged to use top-level services to interface with the SCM, rather than coding directly to the SCM tier. Using the top-level services provides better support for multiple SCMs, as well as providing additional functionality to augment what the SCMs provide. In general, most of the functionality provided by the Git SCM is better accessed via the following services:

  • CommitService
  • CompareService
  • ContentService
  • PullRequestService
  • RefService
  • RepositoryService
when coding directly to the Git SCM, plugin developers should always check the repository's SCM ID on the repository before attempting to run Git commands against it.
  • Field Details

  • Method Details

    • getBulkContentCommandFactory

      @Nonnull GitBulkContentCommandFactory getBulkContentCommandFactory()
      Specified by:
      getBulkContentCommandFactory in interface com.atlassian.bitbucket.scm.Scm
      Returns:
      a command factory providing support for bulk operations
    • getCommandBuilderFactory

      @Nonnull GitCommandBuilderFactory getCommandBuilderFactory()
      Specified by:
      getCommandBuilderFactory in interface com.atlassian.bitbucket.scm.Scm
      Returns:
      a factory for creating builders, used to assemble custom commands using either free-form arguments or type-safe wrappers around git commands like diff and rev-list
    • getCommandFactory

      @Nonnull GitCommandFactory getCommandFactory()
      Specified by:
      getCommandFactory in interface com.atlassian.bitbucket.scm.Scm
      Returns:
      a command factory providing standard SCM functionality, like the ability to list branches or diff two commits
    • getCompareCommandFactory

      @Nonnull GitCompareCommandFactory getCompareCommandFactory()
      Specified by:
      getCompareCommandFactory in interface com.atlassian.bitbucket.scm.Scm
      Returns:
      a command factory for comparing refs within and between repositories
    • getExtendedCommandFactory

      @Nonnull GitExtendedCommandFactory getExtendedCommandFactory()
      Specified by:
      getExtendedCommandFactory in interface com.atlassian.bitbucket.scm.Scm
      Returns:
      a command factory providing extended SCM functionality
      Since:
      4.6
    • getIntegrityCheckCommandFactory

      @Nonnull GitIntegrityCheckCommandFactory getIntegrityCheckCommandFactory()
      Specified by:
      getIntegrityCheckCommandFactory in interface com.atlassian.bitbucket.scm.Scm
      Returns:
      a command factory to perform integrity checks
      Since:
      4.12
      See Also:
      • Scm.getIntegrityCheckCommandFactory()
    • getMergeStrategies

      @Nonnull com.atlassian.bitbucket.scm.PluginMergeStrategies getMergeStrategies()
      Specified by:
      getMergeStrategies in interface com.atlassian.bitbucket.scm.Scm
      Returns:
      a set of merge strategies supported by the Git SCM
      Since:
      4.9
    • getMinimumVersion

      @Nonnull com.atlassian.bitbucket.util.Version getMinimumVersion()
      Returns:
      the minimum supported git version.
    • getPullRequestCommandFactory

      @Nonnull GitPullRequestCommandFactory getPullRequestCommandFactory()
      Specified by:
      getPullRequestCommandFactory in interface com.atlassian.bitbucket.scm.Scm
      Returns:
      a command factory for displaying and merging pull requests within and between repositories
    • getRefCommandFactory

      @Nonnull GitRefCommandFactory getRefCommandFactory()
      Specified by:
      getRefCommandFactory in interface com.atlassian.bitbucket.scm.Scm
      Returns:
      a command factory for mutating refs
    • getVersion

      @Nonnull Optional<com.atlassian.bitbucket.util.Version> getVersion()
      Retrieves the git version, if an acceptable version was found. If git was not found, or is not an acceptable version, empty() is returned.
      Returns:
      the git version, or empty() if git was not found or was not an acceptable version
      Since:
      5.10
    • getWorkTreeBuilderFactory

      @Nonnull GitWorkTreeBuilderFactory getWorkTreeBuilderFactory()
      Returns:
      a factory providing support for creating work trees.
      Since:
      7.14
      See Also: