{"id":13461479,"url":"https://github.com/go-git/go-git","last_synced_at":"2026-04-16T23:06:34.737Z","repository":{"id":37359492,"uuid":"229030654","full_name":"go-git/go-git","owner":"go-git","description":"A highly extensible Git implementation in pure Go.","archived":false,"fork":false,"pushed_at":"2025-05-05T13:42:54.000Z","size":5726,"stargazers_count":6494,"open_issues_count":175,"forks_count":787,"subscribers_count":44,"default_branch":"main","last_synced_at":"2025-05-05T15:54:57.147Z","etag":null,"topics":["git","git-client","git-server","go-git","golang"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/go-git/go-git/v5","language":"Go","has_issues":true,"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/go-git.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-12-19T10:27:02.000Z","updated_at":"2025-05-05T15:53:53.000Z","dependencies_parsed_at":"2023-12-08T10:30:13.959Z","dependency_job_id":"861bac08-c505-4b3f-b11d-676bcd20f195","html_url":"https://github.com/go-git/go-git","commit_stats":{"total_commits":1612,"total_committers":281,"mean_commits":5.736654804270462,"dds":0.7295285359801489,"last_synced_commit":"9d9aa3689f31b24e14c2a48ae579a3513e58b4de"},"previous_names":[],"tags_count":79,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-git%2Fgo-git","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-git%2Fgo-git/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-git%2Fgo-git/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-git%2Fgo-git/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-git","download_url":"https://codeload.github.com/go-git/go-git/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253074565,"owners_count":21849783,"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":["git","git-client","git-server","go-git","golang"],"created_at":"2024-07-31T11:00:40.136Z","updated_at":"2026-04-16T23:06:34.446Z","avatar_url":"https://github.com/go-git.png","language":"Go","readme":"![go-git logo](https://cdn.rawgit.com/src-d/artwork/02036484/go-git/files/go-git-github-readme-header.png)\n[![GoDoc](https://godoc.org/github.com/go-git/go-git/v6?status.svg)](https://pkg.go.dev/github.com/go-git/go-git/v6) [![Build Status](https://github.com/go-git/go-git/workflows/Test/badge.svg)](https://github.com/go-git/go-git/actions) [![Go Report Card](https://goreportcard.com/badge/github.com/go-git/go-git)](https://goreportcard.com/report/github.com/go-git/go-git) [![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/go-git/go-git/badge)](https://scorecard.dev/viewer/?uri=github.com/go-git/go-git)\n\n*go-git* is a highly extensible git implementation library written in **pure Go**.\n\nIt can be used to manipulate git repositories at low level *(plumbing)* or high level *(porcelain)*, through an idiomatic Go API. It also supports several types of storage, such as in-memory filesystems, or custom implementations, thanks to the [`Storer`](https://pkg.go.dev/github.com/go-git/go-git/v6/plumbing/storer) interface.\n\nIt's being actively developed since 2015 and is being used extensively by [Keybase](https://keybase.io/blog/encrypted-git-for-everyone), [Gitea](https://gitea.io/en-us/) or [Pulumi](https://github.com/search?q=org%3Apulumi+go-git\u0026type=Code), and by many other libraries and tools.\n\nProject Status\n--------------\n\nAfter the [legal issues](https://github.com/src-d/go-git/issues/1295#issuecomment-592965250) with the [`src-d`](https://github.com/src-d) organization, the lack of update for four months and the requirement to make a hard fork, the project is **now back to normality**.\n\nThe project is currently actively maintained by individual contributors, including several of the original authors, but also backed by a new company, [gitsight](https://github.com/gitsight), where `go-git` is a critical component used at scale.\n\n\nComparison with git\n-------------------\n\n*go-git* aims to be fully compatible with [git](https://github.com/git/git), all the *porcelain* operations are implemented to work exactly as *git* does.\n\n*git* is a humongous project with years of development by thousands of contributors, making it challenging for *go-git* to implement all the features. You can find a comparison of *go-git* vs *git* in the [compatibility documentation](COMPATIBILITY.md).\n\n\nInstallation\n------------\n\nThe recommended way to install *go-git* is:\n\n```go\nimport \"github.com/go-git/go-git/v6\" // with go modules enabled (GO111MODULE=on or outside GOPATH)\nimport \"github.com/go-git/go-git\" // with go modules disabled\n```\n\n\nExamples\n--------\n\n\u003e Please note that the `CheckIfError` and `Info` functions  used in the examples are from the [examples package](https://github.com/go-git/go-git/blob/master/_examples/common.go#L19) just to be used in the examples.\n\n\n### Basic example\n\nA basic example that mimics the standard `git clone` command\n\n```go\n// Clone the given repository to the given directory\nInfo(\"git clone https://github.com/go-git/go-git\")\n\n_, err := git.PlainClone(\"/tmp/foo\", \u0026git.CloneOptions{\n    URL:      \"https://github.com/go-git/go-git\",\n    Progress: os.Stdout,\n})\n\nCheckIfError(err)\n```\n\nOutputs:\n```\nCounting objects: 4924, done.\nCompressing objects: 100% (1333/1333), done.\nTotal 4924 (delta 530), reused 6 (delta 6), pack-reused 3533\n```\n\n### In-memory example\n\nCloning a repository into memory and printing the history of HEAD, just like `git log` does\n\n\n```go\n// Clones the given repository in memory, creating the remote, the local\n// branches and fetching the objects, exactly as:\nInfo(\"git clone https://github.com/go-git/go-billy\")\n\nr, err := git.Clone(memory.NewStorage(), nil, \u0026git.CloneOptions{\n    URL: \"https://github.com/go-git/go-billy\",\n})\n\nCheckIfError(err)\n\n// Gets the HEAD history from HEAD, just like this command:\nInfo(\"git log\")\n\n// ... retrieves the branch pointed by HEAD\nref, err := r.Head()\nCheckIfError(err)\n\n\n// ... retrieves the commit history\ncIter, err := r.Log(\u0026git.LogOptions{From: ref.Hash()})\nCheckIfError(err)\n\n// ... just iterates over the commits, printing it\nerr = cIter.ForEach(func(c *object.Commit) error {\n\tfmt.Println(c)\n\treturn nil\n})\nCheckIfError(err)\n```\n\nOutputs:\n```\ncommit ded8054fd0c3994453e9c8aacaf48d118d42991e\nAuthor: Santiago M. Mola \u003csanti@mola.io\u003e\nDate:   Sat Nov 12 21:18:41 2016 +0100\n\n    index: ReadFrom/WriteTo returns IndexReadError/IndexWriteError. (#9)\n\ncommit df707095626f384ce2dc1a83b30f9a21d69b9dfc\nAuthor: Santiago M. Mola \u003csanti@mola.io\u003e\nDate:   Fri Nov 11 13:23:22 2016 +0100\n\n    readwriter: fix bug when writing index. (#10)\n\n    When using ReadWriter on an existing siva file, absolute offset for\n    index entries was not being calculated correctly.\n...\n```\n\nYou can find this [example](_examples/log/main.go) and many others in the [examples](_examples) folder.\n\nContribute\n----------\n\n[Contributions](https://github.com/go-git/go-git/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) are more than welcome, if you are interested please take a look to\nour [Contributing Guidelines](CONTRIBUTING.md).\n\nLicense\n-------\nApache License Version 2.0, see [LICENSE](LICENSE)\n","funding_links":[],"categories":["Version Control","Go","开源类库","Utility","Open source library","版本控制"],"sub_categories":["Utility/Miscellaneous","Git","HTTP Clients","实用程序/Miscellaneous","Fail injection"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-git%2Fgo-git","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-git%2Fgo-git","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-git%2Fgo-git/lists"}