The Groovy way to use Git.
Grgit is a way to interact with Git repositories with a fairly fluent Groovy API. JGit can get pretty tedious to use, especially in a scripting context.
Grgit will also be the base for a rewrite of the gradle-git plugin.
Grgit is published on JCenter and Maven Central. As of 3/30/2014, not all dependencies are in JCenter.
repositories {
jcenter()
mavenCentral()
}
dependencies {
compile 'org.ajoberstar:grgit:<version>'
}
Start at the main entry point class Grgit. This should link to all of the ways to call different operations.
For authentication, see AuthConfig.
The documentation home is here.
I've added most of the core operations so far, and you can see the issue tracker for planned features.
If an existing operation is missing an option, it most likely means one of the following things:
- I don't have a use case for it.
- I wasn't able to put together a test that could describe/validate the behavior of the option.
- JGit doesn't support it.
If you're interested in a change, please submit an issue (or even better a pull request with tests).
- Removed deprecated Grgit#resolveCommit(Object) method.
- Deprecated the Grgit#open(String, Credentials) and Grgit#open(File, Credentials) methods, which are replaced with OpenOp to be consistent with all other methods.
- Supporting more types for the directories in OpenOp, InitOp, and CloneOp. Can be a File, Path, or Object (which will be toString'd).
- Added support for remote add/list. Thanks to Adam Dubiel.
- Implement #37 to support an
orphan
checkout.
- Breaking change: Updating to Groovy 2.x.
- Allow empty passwords in hardcoded credentials to support Github auth tokens and similar use cases.
- Support authentication on PullOp.
- Fix for #24 making closure syntax for operations work in gradle-git.
- Support netcat as an alternative to JNA for sshagent connections.
- Added
close()
method toGrgit
to release resources. - Support system properties for hardcoded credentials.
- Fix for some JNA issues when using ssh-agent.
- Added a bunch of new operations. See the Groovydoc for details.
- Initial release!