{"id":19865061,"url":"https://github.com/glweems/gatsby-source-git-remotes","last_synced_at":"2026-05-13T04:43:03.169Z","repository":{"id":35048990,"uuid":"199095855","full_name":"glweems/gatsby-source-git-remotes","owner":"glweems","description":"Gatsby plugin for pulling files into Gatsby from multiple Git repositories","archived":false,"fork":false,"pushed_at":"2022-12-07T15:06:06.000Z","size":632,"stargazers_count":1,"open_issues_count":15,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-11T15:39:12.213Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/glweems.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-27T00:23:40.000Z","updated_at":"2023-03-09T02:18:29.000Z","dependencies_parsed_at":"2023-01-15T12:45:29.064Z","dependency_job_id":null,"html_url":"https://github.com/glweems/gatsby-source-git-remotes","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/glweems%2Fgatsby-source-git-remotes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glweems%2Fgatsby-source-git-remotes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glweems%2Fgatsby-source-git-remotes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glweems%2Fgatsby-source-git-remotes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/glweems","download_url":"https://codeload.github.com/glweems/gatsby-source-git-remotes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241274264,"owners_count":19937149,"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-11-12T15:20:50.745Z","updated_at":"2026-05-13T04:43:03.115Z","avatar_url":"https://github.com/glweems.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gatsby-source-git-remotes\n\nSource plugin for pulling files into the Gatsby graph from abitrary Git repositories (hosted anywhere). This is useful if the markdown files you wish to render can't live within your gatsby codebase, or if need to aggregate content from disparate repositories.\n\nIt clones the repo(s) you configure (a shallow clone, into your cache folder if\nyou're interested), and then sucks the files into the graph as `File` nodes, as\nif you'd configured\n[`gatsby-source-filesystem`](https://www.gatsbyjs.org/packages/gatsby-source-filesystem/)\non that directory. As such, all the tranformer plugins that operate on files\nshould work exactly as they do with `gatsby-source-filesystem` eg with\n`gatsby-transformer-remark`, `gatsby-transformer-json` etc.\n\nThe only difference is that the `File` nodes created by this plugin will\nalso have a `gitRemote` field, which will provide you with various bits of\nGit related information. The fields on the `gitRemote` node are\nmostly provided by\n[IonicaBazau/git-url-parse](https://github.com/IonicaBizau/git-url-parse), with\nthe addition of `ref` and `weblink` fields, which are\nthe 2 main things you probably want if you're constructing \"edit on github\"\nstyle links.\n\n## Requirements\n\nRequires [git](http://git-scm.com/downloads) to be installed, and to be callable using the command `git`.\n\nIdeally we'd use [nodegit](https://github.com/nodegit/nodegit), but it doesn't support shallow clones (see [libgit2/libgit2#3058](https://github.com/libgit2/libgit2/issues/3058)) which would have a significant effect on build times if you wanted to read files from git repositories with large histories.\n\nOnly public repositories are supported right now. But a PR should be simple enough if you want that.\n\n## Install\n\nNot published on npm yet, so for now:\n\n`npm install --save gatsby-source-git-remotes`\n\nor\n\n`yarn add gatsby-source-git-remotes`\n## How to use\n\n```javascript\n// In your gatsby-config.js\nmodule.exports = {\n  plugins: [\n   {\n      resolve: `gatsby-source-git`,\n      options: {\n        repos: [\n          {\n            name: `react-peekaboo-navbar`,\n            remote: `https://github.com/gwtuts/react-peekaboo-navbar.git`,\n            patterns: [`*.jpg`],\n          },\n          {\n            name: `react-navbar-scroller`,\n            remote: `https://github.com/gwtuts/react-navbar-scroller.git`,\n            patterns: [`*.jpg`],\n          },\n          {\n            name: `gatsby-darkmode`,\n            remote: `https://github.com/gwtuts/gatsby-darkmode.git`,\n            patterns: [`*.jpg`],\n          },\n          {\n            name: `styled-container`,\n            remote: `https://github.com/gwtuts/styled-container.git`,\n            patterns: [`*.md`],\n          },\n        ],\n      },\n    },\n  ]\n};\n```\n\n## How to query\n\nYou can query file nodes exactly as you would node query for nodes created with\n[`gatsby-source-filesystem`](https://www.gatsbyjs.org/packages/gatsby-source-filesystem/),\neg:\n\n```graphql\n{\n  allFile {\n    edges {\n      node {\n        extension\n        dir\n        modifiedTime\n      }\n    }\n  }\n}\n```\n\nSimilarly, you can filter by the `name` you specified in the config by using\n`sourceInstanceName`:\n\n```graphql\n{\n  allFile(filter: { sourceInstanceName: { eq: \"repo-one\" } }) {\n    edges {\n      node {\n        extension\n        dir\n        modifiedTime\n      }\n    }\n  }\n}\n```\n\nAnd access some information about the git repo:\n\n```graphql\n{\n  allFile {\n    edges {\n      node {\n        gitRemote {\n          webLink\n          ref\n        }\n      }\n    }\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglweems%2Fgatsby-source-git-remotes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglweems%2Fgatsby-source-git-remotes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglweems%2Fgatsby-source-git-remotes/lists"}