JSPM

  • Created
  • Published
  • Downloads 41578
  • Score
    100M100P100Q146571F

Git plugin for Gulp (gulpjs.com)

Package Exports

  • gulp-git

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gulp-git) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

#gulp-git Build Status NPM version

Packagegulp-git
Description Git plugin for Gulp (gulpjs.com)
Node Version >= 0.8
Gulp Version 3.x

Usage

Install

npm install gulp-git --save

##Example

var gulp = require('gulp');
var git = require('../');

// Run git init 
// src is the root folder for git to initialize
gulp.task('init', function(){
  gulp.src('./')
  .pipe(git.init());
});

// Run git add 
// src is the file(s) to add (or ./*)
gulp.task('add', function(){
  gulp.src('./git-test/*')
  .pipe(git.add());
});

// Run git commit
// src are the files to commit (or ./*)
gulp.task('commit', function(){
  gulp.src('./git-test/*')
  .pipe(git.commit({message:'initial commit'}));
});

// Run git remote add
// remote is the remote repo
// repo is the https url of the repo
gulp.task('remote', function(){
  gulp.src('./')
  .pipe(git.addRemote({remote:'origin', url:'https://github.com/stevelacy/git-test'}));
});

// Run git push 
// remote is the remote repo
// branch is the remote branch to push to
gulp.task('push', function(){
  gulp.src('./')
  .pipe(git.push({remote:'origin', branch:'master'}));
});

// Run git pull
// remote is the remote repo
// branch is the remote branch to pull from
gulp.task('pull', function(){
  gulp.src('./')
  .pipe(git.pull({remote:'origin', branch:'master'}));
});



// Run gulp's default task
gulp.task('default', function(){
  gulp.run('add');
});

##API

git.init()

git init

Creates an empty git repo

git.add()

git add <files>

Adds files to repo

git.commit()

git commit -m <message> <files>

Commits changes to repo

git.addRemote()

git remote add <remote> <repo https url>

defaults:
remote: 'origin'

Adds remote repo url

git.pull()

git pull <remote> <branch>

defaults:
remote: 'origin'
branch: 'master'

Pulls changes from remote repo

git.push()

git push <remote> <branch>

defaults:
remote: 'origin'
branch: 'master'

Pushes changes to remote repo

####You can view more examples in the example folder.

LICENSE

(MIT License)

Copyright (c) 2014 Steve Lacy me@slacy.me slacy.me - Fractal contact@wearefractal.com wearefractal.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.