Git-CMD

Common module that all Go CD plugins can use to poll Git repository.

License

License

Categories

Categories

Ant Build Tools Git Development Tools Version Controls
GroupId

GroupId

in.ashwanthkumar
ArtifactId

ArtifactId

git-cmd
Last Version

Last Version

2.0
Release Date

Release Date

Type

Type

jar
Description

Description

Git-CMD
Common module that all Go CD plugins can use to poll Git repository.
Project URL

Project URL

https://github.com/ashwanthkumar/git-cmd
Source Code Management

Source Code Management

https://github.com/ashwanthkumar/git-cmd

Download git-cmd

How to add to project

<!-- https://jarcasting.com/artifacts/in.ashwanthkumar/git-cmd/ -->
<dependency>
    <groupId>in.ashwanthkumar</groupId>
    <artifactId>git-cmd</artifactId>
    <version>2.0</version>
</dependency>
// https://jarcasting.com/artifacts/in.ashwanthkumar/git-cmd/
implementation 'in.ashwanthkumar:git-cmd:2.0'
// https://jarcasting.com/artifacts/in.ashwanthkumar/git-cmd/
implementation ("in.ashwanthkumar:git-cmd:2.0")
'in.ashwanthkumar:git-cmd:jar:2.0'
<dependency org="in.ashwanthkumar" name="git-cmd" rev="2.0">
  <artifact name="git-cmd" type="jar" />
</dependency>
@Grapes(
@Grab(group='in.ashwanthkumar', module='git-cmd', version='2.0')
)
libraryDependencies += "in.ashwanthkumar" % "git-cmd" % "2.0"
[in.ashwanthkumar/git-cmd "2.0"]

Dependencies

compile (4)

Group / Artifact Type Version
org.eclipse.jgit : org.eclipse.jgit jar 5.5.1.201910021850-r
joda-time : joda-time jar 2.10.3
org.apache.commons : commons-exec jar 1.3
commons-io : commons-io jar 2.6

test (2)

Group / Artifact Type Version
junit : junit jar 4.12
org.hamcrest : hamcrest-core jar 2.2

Project Modules

There are no modules declared in this project.

git-cmd

Maven Central

git-cmd is a common Git helper module that all GoCD plugins needing to poll or interact with Git repositories can use.

This is a fork of srinivasupadhya/git-cmd, being maintained in support of the several GoCD Git-based plugins.

Compatibility

Plugin Version Java Version for GoCD
< 2.0 7+
>= 2.0 9+

Features

  • Supports detection of whether the git command line client is installed, with fallback to JGit if it is not available
  • Intended to support most operations of the upstream GoCD Git Material and GitCommand upon which this library is based.
  • Most regular Git operations required by such a plugin are supported
    • clone
      • git command line only --depth=1 shallow clones, and unshallowing when necessary (since 2.0)
      • git command line only --no-checkout mode
    • fetch from refSpec
    • clean working directories
    • hard reset
    • pull
    • find revision operations
      • latest revision
      • revisions since
      • revision details
      • get current revision
      • get all revisions
      • get commit count (when not on a shallow clone)
      • filter revision searches by repo subpaths
    • submodule support
    • add, commit, push

Usage

Add Dependency (to plugin project):

Maven

<dependency>
    <groupId>in.ashwanthkumar</groupId>
    <artifactId>git-cmd</artifactId>
    <version>2.0</version>
</dependency>

Gradle

dependencies {
    implementation 'in.ashwanthkumar:git-cmd:2.0'
}

Use:

GitConfig config = new GitConfig("[email protected]:ashwanthkumar/git-cmd.git");
GitHelper git = HelperFactory.git(gitConfig, new File(flyweightFolder));
git.cloneOrFetch();
//...

Development

Building:

$ mvn clean install

Versions

Version
2.0
1.4
1.3
1.2
1.1
1.0