{"id":16359756,"url":"https://github.com/jmsv/memgit","last_synced_at":"2025-12-31T14:30:18.532Z","repository":{"id":95749761,"uuid":"150412234","full_name":"jmsv/memgit","owner":"jmsv","description":"uses isomorphic-git and memfs to host an in-memory git repo","archived":false,"fork":false,"pushed_at":"2018-11-14T18:49:17.000Z","size":497,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-29T17:34:10.888Z","etag":null,"topics":["isomorphic-git","javascript","memfs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jmsv.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-26T10:54:51.000Z","updated_at":"2021-12-03T17:27:46.000Z","dependencies_parsed_at":"2023-05-21T21:15:31.621Z","dependency_job_id":null,"html_url":"https://github.com/jmsv/memgit","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/jmsv%2Fmemgit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmsv%2Fmemgit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmsv%2Fmemgit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmsv%2Fmemgit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmsv","download_url":"https://codeload.github.com/jmsv/memgit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239727035,"owners_count":19687096,"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":["isomorphic-git","javascript","memfs"],"created_at":"2024-10-11T02:09:35.058Z","updated_at":"2025-12-31T14:30:18.498Z","avatar_url":"https://github.com/jmsv.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# memgit\n\n__uses [isomorphic-git](https://github.com/isomorphic-git/isomorphic-git) and [memfs](https://github.com/streamich/memfs) to host an in-memory git repo!__\n\n(At the moment it's just a proof-of-concept - I'm not sure what to do about git's compressed objects although there's probably a way to magically store them as text)\n\n#### why did u make this tho\n\nI don't have much use for this and made it for fun tbh, although it could potentially be useful for storing a git repo in a document-based (e.g. MongoDB) database\n\nIn the future (given time and motivation) I might get this working properly and turn it into something more reusable\n\n---\n\nThe code I wrote trying to get this to work:\n\n```js\nvar fsReal = require('fs')\n\nvar fs = require('memfs').fs\nvar vol = require('memfs').vol\n\nvar git = require('isomorphic-git')\n\ngit.plugins.set('fs', fs)\n\nasync function main () {\n  await git.init({ dir: '/' })\n\n  fs.writeFileSync('/avocado.txt', 'avocado content')\n\n  await git.add({dir: '/', filepath: '/avocado.txt'})\n\n  await git.commit({\n    dir: '/',\n    author: {\n      name: 'James Vickery',\n      email: 'dev@jamesvickery.net'\n    },\n    message: 'added avocado'\n  })\n\n  const repoJson = vol.toJSON()\n\n  fsReal.writeFileSync('repo.json', JSON.stringify(repoJson, null, 2))\n}\n\nmain()\n```\n\n![output](img/output.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmsv%2Fmemgit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmsv%2Fmemgit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmsv%2Fmemgit/lists"}