[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-8072":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":10,"pushedAt":10,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":16,"starSnapshotCount":16,"syncStatus":27,"lastSyncTime":28,"discoverSource":29},8072,"grit","mojombo\u002Fgrit","mojombo","**Grit is no longer maintained. Check out libgit2\u002Frugged.** Grit gives you object oriented read\u002Fwrite access to Git repositories via Ruby.","http:\u002F\u002Fgrit.rubyforge.org\u002F",null,"Ruby",2022,510,65,70,0,8,30.13,"MIT License",false,"master",true,[],"2026-06-12 02:01:48","Grit\n====\n\n**Grit is no longer maintained. Check out [rugged](https:\u002F\u002Fgithub.com\u002Flibgit2\u002Frugged).**\n\nGrit gives you object oriented read\u002Fwrite access to Git repositories via Ruby.\nThe main goals are stability and performance. To this end, some of the\ninteractions with Git repositories are done by shelling out to the system's\n`git` command, and other interactions are done with pure Ruby\nreimplementations of core Git functionality. This choice, however, is\ntransparent to end users, and you need not know which method is being used.\n\nThis software was developed to power GitHub, and should be considered\nproduction ready. An extensive test suite is provided to verify its\ncorrectness.\n\nGrit is maintained by Tom Preston-Werner, Scott Chacon, Chris Wanstrath, and\nPJ Hyett.\n\nThis documentation is accurate as of Grit 2.3.\n\n\n## Requirements\n\n* git (http:\u002F\u002Fgit-scm.com) tested with 1.7.2.1\n\n\n## Install\n\nEasiest install is via RubyGems:\n\n    $ gem install grit\n\n\n## Source\n\nGrit's Git repo is available on GitHub, which can be browsed at:\n\n    http:\u002F\u002Fgithub.com\u002Fmojombo\u002Fgrit\n\nand cloned with:\n\n    git clone git:\u002F\u002Fgithub.com\u002Fmojombo\u002Fgrit.git\n\n\n### Development\n\nYou will need these gems to get tests to pass:\n\n* mocha\n\n\n### Contributing\n\nIf you'd like to hack on Grit, follow these instructions. To get all of the dependencies, install the gem first.\n\n1. Fork the project to your own account\n1. Clone down your fork\n1. Create a thoughtfully named topic branch to contain your change\n1. Hack away\n1. Add tests and make sure everything still passes by running `rake`\n1. If you are adding new functionality, document it in README.md\n1. Do not change the version number, I will do that on my end\n1. If necessary, rebase your commits into logical chunks, without errors\n1. Push the branch up to GitHub\n1. Send a pull request for your branch\n\n\n## Usage\n\nGrit gives you object model access to your Git repositories. Once you have\ncreated a `Repo` object, you can traverse it to find parent commits,\ntrees, blobs, etc.\n\n\n### Initialize a Repo object\n\nThe first step is to create a `Grit::Repo` object to represent your repo. In\nthis documentation I include the `Grit` module to reduce typing.\n\n    require 'grit'\n    repo = Grit::Repo.new(\"\u002FUsers\u002Ftom\u002Fdev\u002Fgrit\")\n\nIn the above example, the directory `\u002FUsers\u002Ftom\u002Fdev\u002Fgrit` is my working\ndirectory and contains the `.git` directory. You can also initialize Grit with\na bare repo.\n\n    repo = Repo.new(\"\u002Fvar\u002Fgit\u002Fgrit.git\")\n\n\n### Getting a list of commits\n\nFrom the `Repo` object, you can get a list of commits as an array of `Commit`\nobjects.\n\n    repo.commits\n    # => [#\u003CGrit::Commit \"e80bbd2ce67651aa18e57fb0b43618ad4baf7750\">,\n          #\u003CGrit::Commit \"91169e1f5fa4de2eaea3f176461f5dc784796769\">,\n          #\u003CGrit::Commit \"038af8c329ef7c1bae4568b98bd5c58510465493\">,\n          #\u003CGrit::Commit \"40d3057d09a7a4d61059bca9dca5ae698de58cbe\">,\n          #\u003CGrit::Commit \"4ea50f4754937bf19461af58ce3b3d24c77311d9\">]\n\nCalled without arguments, `Repo#commits` returns a list of up to ten commits\nreachable by the **master** branch (starting at the latest commit). You can\nask for commits beginning at a different branch, commit, tag, etc.\n\n    repo.commits('mybranch')\n    repo.commits('40d3057d09a7a4d61059bca9dca5ae698de58cbe')\n    repo.commits('v0.1')\n\nYou can specify the maximum number of commits to return.\n\n    repo.commits('master', 100)\n\nIf you need paging, you can specify a number of commits to skip.\n\n    repo.commits('master', 10, 20)\n\nThe above will return commits 21-30 from the commit list.\n\n\n### The Commit object\n\n`Commit` objects contain information about that commit.\n\n    head = repo.commits.first\n\n    head.id\n    # => \"e80bbd2ce67651aa18e57fb0b43618ad4baf7750\"\n\n    head.parents\n    # => [#\u003CGrit::Commit \"91169e1f5fa4de2eaea3f176461f5dc784796769\">]\n\n    head.tree\n    # => #\u003CGrit::Tree \"3536eb9abac69c3e4db583ad38f3d30f8db4771f\">\n\n    head.author\n    # => #\u003CGrit::Actor \"Tom Preston-Werner \u003Ctom@mojombo.com>\">\n\n    head.authored_date\n    # => Wed Oct 24 22:02:31 -0700 2007\n\n    head.committer\n    # => #\u003CGrit::Actor \"Tom Preston-Werner \u003Ctom@mojombo.com>\">\n\n    head.committed_date\n    # => Wed Oct 24 22:02:31 -0700 2007\n\n    head.message\n    # => \"add Actor inspect\"\n\nYou can traverse a commit's ancestry by chaining calls to `#parents`.\n\n    repo.commits.first.parents[0].parents[0].parents[0]\n\nThe above corresponds to **master^^^** or **master~3** in Git parlance.\n\n\n### The Tree object\n\nA tree records pointers to the contents of a directory. Let's say you want\nthe root tree of the latest commit on the **master** branch.\n\n    tree = repo.commits.first.tree\n    # => #\u003CGrit::Tree \"3536eb9abac69c3e4db583ad38f3d30f8db4771f\">\n\n    tree.id\n    # => \"3536eb9abac69c3e4db583ad38f3d30f8db4771f\"\n\nOnce you have a tree, you can get the contents.\n\n    contents = tree.contents\n    # => [#\u003CGrit::Blob \"4ebc8aea50e0a67e000ba29a30809d0a7b9b2666\">,\n          #\u003CGrit::Blob \"81d2c27608b352814cbe979a6acd678d30219678\">,\n          #\u003CGrit::Tree \"c3d07b0083f01a6e1ac969a0f32b8d06f20c62e5\">,\n          #\u003CGrit::Tree \"4d00fe177a8407dbbc64a24dbfc564762c0922d8\">]\n\nThis tree contains two `Blob` objects and two `Tree` objects. The trees are\nsubdirectories and the blobs are files. Trees below the root have additional\nattributes.\n\n    contents.last.name\n    # => \"lib\"\n\n    contents.last.mode\n    # => \"040000\"\n\nThere is a convenience method that allows you to get a named sub-object\nfrom a tree.\n\n    tree \u002F \"lib\"\n    # => #\u003CGrit::Tree \"e74893a3d8a25cbb1367cf241cc741bfd503c4b2\">\n\nYou can also get a tree directly from the repo if you know its name.\n\n    repo.tree\n    # => #\u003CGrit::Tree \"master\">\n\n    repo.tree(\"91169e1f5fa4de2eaea3f176461f5dc784796769\")\n    # => #\u003CGrit::Tree \"91169e1f5fa4de2eaea3f176461f5dc784796769\">\n\n\n### The Blob object\n\nA blob represents a file. Trees often contain blobs.\n\n    blob = tree.contents.first\n    # => #\u003CGrit::Blob \"4ebc8aea50e0a67e000ba29a30809d0a7b9b2666\">\n\nA blob has certain attributes.\n\n    blob.id\n    # => \"4ebc8aea50e0a67e000ba29a30809d0a7b9b2666\"\n\n    blob.name\n    # => \"README.txt\"\n\n    blob.mode\n    # => \"100644\"\n\n    blob.size\n    # => 7726\n\nYou can get the data of a blob as a string.\n\n    blob.data\n    # => \"Grit is a library to ...\"\n\nYou can also get a blob directly from the repo if you know its name.\n\n    repo.blob(\"4ebc8aea50e0a67e000ba29a30809d0a7b9b2666\")\n    # => #\u003CGrit::Blob \"4ebc8aea50e0a67e000ba29a30809d0a7b9b2666\">\n\n\n### Other\n\nThere are many more API methods available that are not documented here. Please\nreference the code for more functionality.\n\n\nCopyright\n---------\n\nCopyright (c) 2010 Tom Preston-Werner. See LICENSE for details.\n","Grit 是一个通过 Ruby 语言提供面向对象的 Git 仓库读写访问的库。它结合了系统 `git` 命令和纯 Ruby 实现的核心 Git 功能，以确保稳定性和性能。尽管 Grit 不再维护，但其设计目标是为 GitHub 提供支持，并且具备生产环境所需的可靠性，拥有详尽的测试套件来验证其正确性。适用于需要在 Ruby 应用中集成 Git 仓库操作的场景，如版本控制系统、代码管理工具等。请注意，官方推荐使用 libgit2\u002Frugged 作为替代方案。",2,"2026-06-11 03:15:55","top_language"]