0.1.0 • Published 5 years ago
gatsby-plugin-git-clone v0.1.0
gatsby-plugin-git-clone
A simple plugin for Gatsby that clones a remote Git repository before building. This will run git clone when you start Gatsby, with develop or build. If the repository already exists locally, it will update the repository to the latest commit.
This plugin can be used in combination with gatsby-source-filesystem to fetch content from a different repository, for example.
Requirements
- Node.js v10 or newer.
- Git.
Installation
First, install the package using npm or yarn.
yarn add -D gatsby-plugin-git-cloneor
npm install --save-dev gatsby-plugin-git-cloneGetting started
To use the plugin, add it to your gatsby-config.js:
import { resolve } from 'path';
export default {
// ...
plugins: [
{
resolve: 'gatsby-plugin-git-clone',
options: {
repository: 'https://github.com/foo/bar.git',
path: resolve(__dirname, './foo')
}
}
]
}Options
gatsby-plugin-git-clone has a few options:
repository(required) - The remote repository to clone.path(required) - The local path to clone the repository to.branch(optional) - The branch to clone.gitOptions(optional) - The options to pass tosimple-git. See thesimple-gitdocumentation.
0.1.0
5 years ago