{"id":13998387,"url":"https://github.com/SuperSonicHub1/y-git","last_synced_at":"2025-07-23T06:31:29.921Z","repository":{"id":107109112,"uuid":"592035085","full_name":"SuperSonicHub1/y-git","owner":"SuperSonicHub1","description":"Git persistence layer for Y.js","archived":false,"fork":false,"pushed_at":"2023-01-22T18:31:50.000Z","size":43,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-14T03:13:34.420Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SuperSonicHub1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-01-22T18:16:16.000Z","updated_at":"2023-07-31T17:13:12.000Z","dependencies_parsed_at":"2024-01-15T19:44:34.663Z","dependency_job_id":"297d57db-3189-4b7e-9cde-ed2a1a05e981","html_url":"https://github.com/SuperSonicHub1/y-git","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperSonicHub1%2Fy-git","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperSonicHub1%2Fy-git/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperSonicHub1%2Fy-git/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperSonicHub1%2Fy-git/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SuperSonicHub1","download_url":"https://codeload.github.com/SuperSonicHub1/y-git/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227245169,"owners_count":17753239,"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":[],"created_at":"2024-08-09T19:01:37.771Z","updated_at":"2024-11-30T00:31:32.619Z","avatar_url":"https://github.com/SuperSonicHub1.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# y-git\n\nGit persistence layer for Y.js\n\n## Install\n```\nnpm i git+https://github.com/SuperSonicHub1/y-git\n```\nThis project relies on NodeGit, which can be a bit of a pain to install\nsince you'll likely need to compile it from source: https://www.nodegit.org/guides/install/from-source/\n\n## Usage\n```ts\nimport GitPersistence from \"y-git\"\nimport * as Y from \"yjs\"\nimport Git from \"nodegit\"\n\nconst doc = new Y.Doc(),\n\trepo = await Git.Repository.open('repo-name'),\n\tprovider = new GitPersistence(repo, doc)\n\nprovider.on('synced', () =\u003e {\n\t// Do stuff with doc here...\n\n\t// Calls provider.destroy()\n\tdoc.destroy()\n})\n```\n\n## Semantics\nThis library directly maps Y's update log to a Git repository's commit history.\nTherefore, you get a lot of the power that Git gives you for free (although much of it is \nalready given by Y because CRDTs)!\n```\n$ git show\ncommit 9127dcaa3502eaacaaf23f437c536fc7e19db750 (HEAD -\u003e master)\nAuthor: y-git \u003cy-git@kawc.co\u003e\nDate:   Sun Jan 22 13:13:59 2023 -0500\n\n    Update at Sun Jan 22 2023 13:13:59 GMT-0500 (Eastern Standard Time)\n\ndiff --git a/updates b/updates\nindex 8acd12c..8c6fe4a 100644\nBinary files a/updates and b/updates differ\n```\n(If anyone knows how to derive the name of a user from a document update,\nthat would be very much appreciated.)\n\nSyncing your local repo to a remote is likely best handled by a background\ntask which pushes every few minutes; this is an exersice left to the reader.\n\nIn order for this library to function as expected, you must have at least\none existing commit with a file `updates` on the `master` branch. See\n`generate-test-repo` for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSuperSonicHub1%2Fy-git","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSuperSonicHub1%2Fy-git","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSuperSonicHub1%2Fy-git/lists"}