1.5.3 • Published 2 years ago
gulp-gitstage v1.5.3
gulp-gitstage
plugin for gulp to stage files with git
Usage
A plugin for Gulp to stage an object stream of files on git.
First, install gulp-gitstage
as a development dependency:
npm install --save-dev gulp-gitstage
Then, add it to your gulpfile.js
:
const gitstage = require("gulp-gitstage");
const files = gulp.src("./src/*.ext").pipe(gitstage());
files.on("data", function (file) {
console.log("Staged file:", file);
});
API
gitstage(options)
This plugin takes a single object as configuration. The available options are listed below. Note that all options are optional.
option | type | description | default |
---|---|---|---|
gitCwd | String | Override from which directory git is executed. | "./" |
stagedOnly | Boolean | Only stage previously staged files. | false |
Examples
const gitstage = require("gulp-gitstage");
// Stage all files in the pipe
gulp.src("./**/*").pipe(gitstage());
const gitstage = require("gulp-gitstage");
// Stage files only if they're already staged
gulp.src("./**/*").pipe(gitstage({ stagedOnly: true }));
Help
git not found on your system.
'gitCwd' must be a string.
pathspec 'path/to/file' did not match any files
Unable to create '.../.git/index.lock': File exists.