{"id":18649847,"url":"https://github.com/ashwanthkumar/git-cmd","last_synced_at":"2025-04-11T14:32:26.858Z","repository":{"id":9627874,"uuid":"51309512","full_name":"ashwanthkumar/git-cmd","owner":"ashwanthkumar","description":"Common module that all Go CD plugins to poll Git repository can use.","archived":false,"fork":false,"pushed_at":"2024-03-08T23:38:05.000Z","size":277,"stargazers_count":1,"open_issues_count":1,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T14:51:17.261Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ashwanthkumar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-02-08T16:24:52.000Z","updated_at":"2024-01-12T18:07:14.000Z","dependencies_parsed_at":"2024-03-09T00:29:37.632Z","dependency_job_id":"8c0968dc-8629-4709-8291-49380552f415","html_url":"https://github.com/ashwanthkumar/git-cmd","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashwanthkumar%2Fgit-cmd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashwanthkumar%2Fgit-cmd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashwanthkumar%2Fgit-cmd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashwanthkumar%2Fgit-cmd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ashwanthkumar","download_url":"https://codeload.github.com/ashwanthkumar/git-cmd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248419754,"owners_count":21100245,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T06:40:52.016Z","updated_at":"2025-04-11T14:32:21.845Z","avatar_url":"https://github.com/ashwanthkumar.png","language":"Java","readme":"# git-cmd\n\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/in.ashwanthkumar/git-cmd/badge.svg)](https://maven-badges.herokuapp.com/maven-central/in.ashwanthkumar/git-cmd)\n\n`git-cmd` is a common Git helper module that all GoCD plugins needing to poll or interact with\nGit repositories can use.\n\nThis is a fork of [srinivasupadhya/git-cmd](https://github.com/srinivasupadhya/git-cmd/), being maintained\nin support of the several GoCD Git-based plugins.\n\n## Compatibility\n| Plugin Version | Java Version for GoCD |\n|:--------------:|:---------------------:|\n| \u003c 2.0          | 7+                    |\n| \\\u003e= 2.0        | 9+                    |\n\n## Features\n\n* Supports detection of whether the `git` command line client is installed, with fallback to \n[JGit](https://www.eclipse.org/jgit/) if it is not available\n* Intended to support most operations of the upstream [GoCD Git Material](https://github.com/gocd/gocd/blob/master/domain/src/main/java/com/thoughtworks/go/config/materials/git/GitMaterial.java)\n    and [GitCommand](https://github.com/gocd/gocd/blob/master/domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java) \n    upon which this library is based.\n* Most regular `Git` operations required by such a plugin are supported\n    * clone\n        * **git command line only** `--depth=1` shallow clones, and unshallowing when necessary (since `2.0`)\n        * **git command line only** `--no-checkout` mode\n    * fetch from refSpec\n    * clean working directories\n    * hard reset\n    * pull\n    * find revision operations\n        * latest revision\n        * revisions since\n        * revision details\n        * get current revision\n        * get all revisions\n        * get commit count (when not on a shallow clone)\n        * filter revision searches by repo subpaths\n    * submodule support\n    * add, commit, push\n\n##  Usage\nAdd Dependency (to plugin project):\n\nMaven\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ein.ashwanthkumar\u003c/groupId\u003e\n    \u003cartifactId\u003egit-cmd\u003c/artifactId\u003e\n    \u003cversion\u003e2.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nGradle\n```groovy\ndependencies {\n    implementation 'in.ashwanthkumar:git-cmd:2.0'\n}\n```\n\nUse:\n```java\nGitConfig config = new GitConfig(\"git@github.com:ashwanthkumar/git-cmd.git\");\nGitHelper git = HelperFactory.git(gitConfig, new File(flyweightFolder));\ngit.cloneOrFetch();\n//...\n```\n\n## Development\n\nBuilding:\n```\n$ mvn clean install\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashwanthkumar%2Fgit-cmd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fashwanthkumar%2Fgit-cmd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashwanthkumar%2Fgit-cmd/lists"}