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 |
|
Constants
public
static
final
String
ID
public
static
final
String
NAME
Public Methods
Returns
- a command factory providing support for bulk operations
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
Returns
- a command factory for comparing refs within and between repositories
Returns
- a command factory providing extended SCM functionality
Returns
- a command factory to perform integrity checks
Returns
- a set of merge strategies supported by the Git SCM
@Nonnull
public
Version
getMinimumVersion
()
Returns
- a command factory for displaying and merging pull requests within and between repositories
Returns
- a command factory for mutating refs
@Nonnull
public
Optional<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