Description
go-git is an extensible Git implementation written in pure Go, which lets Go programs read and manipulate Git repositories without the git command-line tool. It offers two levels of API: plumbing, for low-level operations on Git objects, and porcelain, for high-level operations that behave like the git commands. Porcelain operations are meant to match git's own behavior, and the project has a compatibility comparison with git in its documentation. Storage is pluggable through the Storer interface, so repositories can be kept in memory or in a custom backend. The project has been developed since 2015 and is used by Keybase, Gitea and Pulumi, among other tools, and it is a dependency of CNCF projects such as Kubernetes Prow and Flux. The README says it is maintained by individual contributors, including several original authors, and backed by GitSight and Entire. The examples include a clone that mimics git clone, and an in-memory example that prints the history of HEAD in the way git log does. The library is released under the Apache License 2.0, and contributions are welcome under its contributing guidelines.…
Highlights
- Git implementation in pure Go
- Plumbing and porcelain APIs
- Pluggable storage, including in-memory
- Clone and log examples
- Apache 2.0 license
Ratings & Reviews
No ratings yet
Be the first to rate Go Git.
People also visit
Go Git FAQ
What is go-git?
A Git implementation in pure Go that Go programs can use to read and manipulate Git repositories.
Does it need the git command installed?
No. It is a pure Go library, so it does not depend on the git binary.
What are plumbing and porcelain?
Plumbing is the low-level API for Git objects, and porcelain is the high-level API for operations like the git commands.
Can repositories live in memory?
Yes. The Storer interface supports in-memory storage and custom implementations.
Is it compatible with git?
The project aims for full compatibility, and it has a comparison with git in its documentation.
What license is it under?
The Apache License Version 2.0.
What are the best Go Git alternatives?
Popular alternatives to Go Git include Isomorphic Git, PuppyGit and GitQlient. See all Go Git alternatives

