[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-11468":3},{"id":4,"name":5,"fullName":6,"owner":5,"repo":5,"description":7,"homepage":8,"htmlUrl":9,"language":10,"languages":8,"totalLinesOfCode":8,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":8,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":8,"rankLanguage":8,"license":8,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":21,"hasPages":21,"topics":23,"createdAt":8,"pushedAt":8,"updatedAt":29,"readmeContent":30,"aiSummary":31,"trendingCount":15,"starSnapshotCount":15,"syncStatus":32,"lastSyncTime":33,"discoverSource":34},11468,"go-git","go-git\u002Fgo-git","A highly extensible Git implementation in pure Go.",null,"https:\u002F\u002Fgithub.com\u002Fgo-git\u002Fgo-git","Go",7518,958,44,124,0,14,25,63,42,39.95,false,"main",[24,25,26,5,27,28],"git","git-client","git-server","golang","git-library","2026-06-12 02:02:31","![go-git logo](https:\u002F\u002Fcdn.rawgit.com\u002Fsrc-d\u002Fartwork\u002F02036484\u002Fgo-git\u002Ffiles\u002Fgo-git-github-readme-header.png)\n[![GoDoc](https:\u002F\u002Fgodoc.org\u002Fgithub.com\u002Fgo-git\u002Fgo-git\u002Fv6?status.svg)](https:\u002F\u002Fpkg.go.dev\u002Fgithub.com\u002Fgo-git\u002Fgo-git\u002Fv6) [![Build Status](https:\u002F\u002Fgithub.com\u002Fgo-git\u002Fgo-git\u002Fworkflows\u002FTest\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fgo-git\u002Fgo-git\u002Factions) [![Go Report Card](https:\u002F\u002Fgoreportcard.com\u002Fbadge\u002Fgithub.com\u002Fgo-git\u002Fgo-git)](https:\u002F\u002Fgoreportcard.com\u002Freport\u002Fgithub.com\u002Fgo-git\u002Fgo-git) [![OpenSSF Scorecard](https:\u002F\u002Fapi.scorecard.dev\u002Fprojects\u002Fgithub.com\u002Fgo-git\u002Fgo-git\u002Fbadge)](https:\u002F\u002Fscorecard.dev\u002Fviewer\u002F?uri=github.com\u002Fgo-git\u002Fgo-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:\u002F\u002Fpkg.go.dev\u002Fgithub.com\u002Fgo-git\u002Fgo-git\u002Fv6\u002Fplumbing\u002Fstorer) interface.\n\nIt has been actively developed since 2015 and is used extensively by [Keybase](https:\u002F\u002Fkeybase.io\u002Fblog\u002Fencrypted-git-for-everyone), [Gitea](https:\u002F\u002Fgitea.io\u002Fen-us\u002F), and [Pulumi](https:\u002F\u002Fgithub.com\u002Fsearch?q=org%3Apulumi+go-git&type=Code), among many other libraries and tools. It is also a dependency in major CNCF projects such as [Kubernetes Prow](https:\u002F\u002Fgithub.com\u002Fkubernetes-sigs\u002Fprow) and [Flux](https:\u002F\u002Ffluxcd.io\u002F).\n\n## Project Status\n\n> For the full backstory see [HISTORY.md](HISTORY.md).\n\nThe project is actively maintained by individual contributors, including several of the original authors. It is backed by [GitSight](https:\u002F\u002Fgithub.com\u002Fgitsight), where `go-git` is a critical component used at scale, and by [Entire](https:\u002F\u002Fentire.io), which supports ongoing maintenance and development of new features.\n\n\n## Comparison with git\n\n*go-git* aims to be fully compatible with [git](https:\u002F\u002Fgithub.com\u002Fgit\u002Fgit), 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\n## Installation\n\nThe recommended way to install *go-git* is:\n\n```go\nimport \"github.com\u002Fgo-git\u002Fgo-git\u002Fv6\"\n```\n\n\n## Examples\n\n> Please note that the `CheckIfError` and `Info` functions used in the examples are from the [examples package](https:\u002F\u002Fgithub.com\u002Fgo-git\u002Fgo-git\u002Fblob\u002Fmain\u002F_examples\u002Fcommon.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\u002F\u002F Clone the given repository to the given directory\nInfo(\"git clone https:\u002F\u002Fgithub.com\u002Fgo-git\u002Fgo-git\")\n\n_, err := git.PlainClone(\"\u002Ftmp\u002Ffoo\", &git.CloneOptions{\n    URL:      \"https:\u002F\u002Fgithub.com\u002Fgo-git\u002Fgo-git\",\n    Progress: os.Stdout,\n})\n\nCheckIfError(err)\n```\n\nOutputs:\n```\nCounting objects: 4924, done.\nCompressing objects: 100% (1333\u002F1333), 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\u002F\u002F Clones the given repository in memory, creating the remote, the local\n\u002F\u002F branches and fetching the objects, exactly as:\nInfo(\"git clone https:\u002F\u002Fgithub.com\u002Fgo-git\u002Fgo-billy\")\n\nr, err := git.Clone(memory.NewStorage(), nil, &git.CloneOptions{\n    URL: \"https:\u002F\u002Fgithub.com\u002Fgo-git\u002Fgo-billy\",\n})\n\nCheckIfError(err)\n\n\u002F\u002F Gets the HEAD history from HEAD, just like this command:\nInfo(\"git log\")\n\n\u002F\u002F ... retrieves the branch pointed by HEAD\nref, err := r.Head()\nCheckIfError(err)\n\n\n\u002F\u002F ... retrieves the commit history\ncIter, err := r.Log(&git.LogOptions{From: ref.Hash()})\nCheckIfError(err)\n\n\u002F\u002F ... 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>\nDate:   Sat Nov 12 21:18:41 2016 +0100\n\n    index: ReadFrom\u002FWriteTo returns IndexReadError\u002FIndexWriteError. (#9)\n\ncommit df707095626f384ce2dc1a83b30f9a21d69b9dfc\nAuthor: Santiago M. Mola \u003Csanti@mola.io>\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\u002Flog\u002Fmain.go) and many others in the [examples](_examples) folder.\n\n## Contribute\n\n[Contributions](https:\u002F\u002Fgithub.com\u002Fgo-git\u002Fgo-git\u002Fissues?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\n## License\nApache License Version 2.0, see [LICENSE](LICENSE)\n","go-git是一个用纯Go语言编写的高度可扩展的Git实现库。它提供了低级别（plumbing）和高级别（porcelain）的操作接口，支持通过Go语言惯用方式对Git仓库进行操作，并且兼容多种存储类型，如内存文件系统或自定义实现，这得益于其`Storer`接口设计。该项目自2015年起持续活跃开发，被广泛应用于包括Keybase、Gitea在内的多个知名项目中，也是Kubernetes Prow等CNCF关键项目的依赖之一。适用于需要直接集成Git功能于Go应用内部、构建定制化的Git客户端或服务器端解决方案等场景。",2,"2026-06-11 03:31:54","trending"]