# gulp-simple-git

> auto git tool

Latest version **1.0.10** (published 2019-09-30) · ISC license · 0 weekly downloads

## Install

```sh
npm install gulp-simple-git
pnpm add gulp-simple-git
yarn add gulp-simple-git
bun add gulp-simple-git
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.10 |
| Published | 2019-09-30 |
| First published | 2019-09-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 7.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Liu Maumasi |
| Maintainers | maumasi |

## Links

- npm: https://www.npmjs.com/package/gulp-simple-git
- npm.io page: https://npm.io/package/gulp-simple-git

## Dependencies (2)

- [yargs](https://npm.io/package/yargs.md) ^14.0.0
- [shelljs](https://npm.io/package/shelljs.md) ^0.8.3

## Recent versions

- 1.0.10 (latest) — 2019-09-30
- 1.0.9 — 2019-09-30
- 1.0.8 — 2019-09-30
- 1.0.7 — 2019-09-30
- 1.0.6 — 2019-09-30
- 1.0.5 — 2019-09-30
- 1.0.4 — 2019-09-30
- 1.0.3 — 2019-09-30
- 1.0.2 — 2019-09-30
- 1.0.1 — 2019-09-30
- 1.0.0 — 2019-09-30
- 0.2.0 — 2019-09-30
- 0.1.11 — 2019-09-30
- 0.1.10 — 2019-09-29
- 0.1.9 — 2019-09-29
- … 9 more at https://npm.io/package/gulp-simple-git/versions

## README

# gulp-simple-git
<p>
A simple Gulp task to run common Git tasks that can be automated.
</p>
</br>

<hr>

## Install

```
npm install --save-dev gulp-simple-git
```

## Use

### Gulp Task

<p>
The module is a higher order function, which returns a Gulp function with the done callback.
</p>

<p>
The following is an example of how to add the module as a Gulp task
</p>

```javascript
const gulp = require('gulp');
const simpleGit = require('gulp-simple-git');

const gitOptions = {
  remote: 'origin', //.........default => 'origin'
  branch: 'master', //.........default => {local working branch}
  addAll: true, //.............`git add .` :: default => false
  commit: true, //.............`git commit` :: default => false
  message: 'auto commit', //...`-m "message to commit"` :: default => [BRANCH: {currentBranch}] | [USER: {user}] | AUTO-COMMIT :: no message for commit.
  push: true, //...............`git push` :: default => false
};
// gulp task with passed options
const { gitTask } = simpleGit(gitOptions);

// gulp task without passed options
const { gitTask } = simpleGit();

// gulp task with options
gulp.task('auto-git-add-commit-and-push', gulp.series(gitTask));
```

</br>

#### Command line options
<p>
Passing options in with command line flags:
</p>


```sh
-R, --remote "origin" #.........default => 'origin'
-B, --branch "master" #.........default => {local working branch}
-a  #...........................`git add .` :: default => false
-c  #...........................`git commit` :: default => false
-m "message to commit" #........`-m "message to commit"` :: default => [BRANCH: {currentBranch}] | [USER: {user}] | AUTO-COMMIT :: no message for commit.
-p #............................`git push` :: default => false
```
</br>

<p>

In additional to the message flag (<code>  -m  </code>), optional auto-generated messages can be generated:
</p>

```sh
-s #...STABLE
-b #...BROKEN
-f #...FEATURE
-x #...HOTFIX
```

##### In Use

```sh
-sm #...[BRANCH: {currentBranch}] | [USER: {user}] | STABLE :: no message for commit.
-bm #...[BRANCH: {currentBranch}] | [USER: {user}] | BROKEN :: no message for commit.
-fm #...[BRANCH: {currentBranch}] | [USER: {user}] | FEATURE :: no message for commit.
-xm #...[BRANCH: {currentBranch}] | [USER: {user}] | HOTFIX :: no message for commit.
```

#### Options object
<p>
Options are passed in as an object:
</p>

```javascript
const gitOptions = {
  remote: 'origin', //.........default => 'origin'
  branch: 'master', //.........default => {local working branch}
  addAll: true, //.............`git add .` :: default => false
  commit: true, //.............`git commit` :: default => false
  message: 'auto commit', //...`-m "message to commit"` :: default => [BRANCH: {currentBranch}] | [USER: {user}] | AUTO-COMMIT :: no message for commit.
  push: true, //...............`git push` :: default => false
};
```
</br>

### Git Info

<p>
Some simple Git info is made available in a way the can be utilized to help create your desired Gulp task for Git.
</p>

```javascript
const gulp = require('gulp');
const simpleGit = require('gulp-simple-git');

const { gitInfo } = simpleGit();

const {
  remotelyTrackedBranches, //...<object> with remote branches as key and an array of their respectively tracked branches
  currentWorkingBranch, //......<string> name of the current working branch
  remoteBranches, //............<array> of remote branches
  localBranches, //.............<array> of local branches
  user, //......................<string> git username
} = gitInfo;

```












</br>

---
_Source: https://npm.io/package/gulp-simple-git · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
