public interface

GitScm

implements Scm
com.atlassian.bitbucket.scm.git.GitScm

Class Overview

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:

  • com.atlassian.bitbucket.commit.CommitService CommitService
  • com.atlassian.bitbucket.compare.CompareService CompareService
  • com.atlassian.bitbucket.content.ContentService ContentService
  • com.atlassian.bitbucket.pull.PullRequestService PullRequestService
  • com.atlassian.bitbucket.repository.RefService RefService
  • com.atlassian.bitbucket.repository.RepositoryService 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.

Summary

Constants
String ID
String NAME
Public Methods
@Nonnull GitBulkContentCommandFactory getBulkContentCommandFactory()
@Nonnull GitCommandBuilderFactory getCommandBuilderFactory()
@Nonnull GitCommandFactory getCommandFactory()
@Nonnull GitCompareCommandFactory getCompareCommandFactory()
@Nonnull GitExtendedCommandFactory getExtendedCommandFactory()
@Nonnull GitIntegrityCheckCommandFactory getIntegrityCheckCommandFactory()
@Nonnull PluginMergeStrategies getMergeStrategies()
@Nonnull Version getMinimumVersion()
@Nonnull GitPullRequestCommandFactory getPullRequestCommandFactory()
@Nonnull GitRefCommandFactory getRefCommandFactory()
[Expand]
Inherited Methods
From interface com.atlassian.bitbucket.scm.Scm

Constants

public static final String ID

Constant Value: "git"

public static final String NAME

Constant Value: "Git"

Public Methods

@Nonnull public GitBulkContentCommandFactory getBulkContentCommandFactory ()

Returns
  • a command factory providing support for bulk operations

@Nonnull public GitCommandBuilderFactory getCommandBuilderFactory ()

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

@Nonnull public GitCommandFactory getCommandFactory ()

Returns
  • a command factory providing standard SCM functionality, like the ability to list branches or diff two commits

@Nonnull public GitCompareCommandFactory getCompareCommandFactory ()

Returns
  • a command factory for comparing refs within and between repositories

@Nonnull public GitExtendedCommandFactory getExtendedCommandFactory ()

Returns
  • a command factory providing extended SCM functionality

@Nonnull public GitIntegrityCheckCommandFactory getIntegrityCheckCommandFactory ()

Returns
  • a command factory to perform integrity checks

@Nonnull public PluginMergeStrategies getMergeStrategies ()

Returns
  • a set of merge strategies supported by the Git SCM

@Nonnull public Version getMinimumVersion ()

Returns
  • the minimum supported Git version.

@Nonnull public GitPullRequestCommandFactory getPullRequestCommandFactory ()

Returns
  • a command factory for displaying and merging pull requests within and between repositories

@Nonnull public GitRefCommandFactory getRefCommandFactory ()

Returns
  • a command factory for mutating refs