# smartgit

> smart git wrapper for node

Latest version **1.0.5** (published 2016-12-31) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install smartgit
pnpm add smartgit
yarn add smartgit
bun add smartgit
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2016-12-31 |
| First published | 2015-11-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 10 |
| Known vulnerabilities | 0 (+10 in 2 direct dependencies) |
| Install scripts | no |
| Author | Smart Coordination GmbH |
| Maintainers | lossless, philkunz |
| Keywords | json, jade, template |

## Links

- npm: https://www.npmjs.com/package/smartgit
- Repository: https://gitlab.com/pushrocks/smartgit
- Issues: https://gitlab.com/pushrocks/smartgit/issues
- npm.io page: https://npm.io/package/smartgit

## Dependencies (10)

- [q](https://npm.io/package/q.md) ^1.4.1
- [shelljs](https://npm.io/package/shelljs.md) ^0.7.5
- [beautylog](https://npm.io/package/beautylog.md) ^6.0.0
- [smartfile](https://npm.io/package/smartfile.md) ^4.1.0
- [smartpath](https://npm.io/package/smartpath.md) ^3.2.5
- [simple-git](https://npm.io/package/simple-git.md) ^1.62.0
- [smartstring](https://npm.io/package/smartstring.md) ^2.0.22
- [@types/shelljs](https://npm.io/package/@types/shelljs.md) ^0.3.32
- [typings-global](https://npm.io/package/typings-global.md) ^1.0.14
- [@types/minimatch](https://npm.io/package/@types/minimatch.md) *

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.5 (latest) — 2016-12-31
- 1.0.4 — 2016-11-26
- 1.0.3 — 2016-11-26
- 1.0.2 — 2016-11-22
- 0.1.10 — 2016-11-21
- 0.1.9 — 2016-07-05
- 0.1.8 — 2016-07-04
- 0.1.7 — 2016-07-04
- 0.1.6 — 2016-07-03
- 0.1.5 — 2016-07-03
- 0.1.3 — 2016-07-02
- 0.1.2 — 2016-07-02
- 0.1.1 — 2016-07-01
- 0.1.0 — 2016-06-28
- 0.0.10 — 2016-04-04
- … 4 more at https://npm.io/package/smartgit/versions

## README

# smartgit
smart git wrapper for node.

smartgit expects git to be installed on target machine.

## Availabililty
[![npm](https://push.rocks/assets/repo-button-npm.svg)](https://www.npmjs.com/package/smartgit)
[![git](https://push.rocks/assets/repo-button-git.svg)](https://gitlab.com/pushrocks/smartgit)
[![git](https://push.rocks/assets/repo-button-mirror.svg)](https://github.com/pushrocks/smartgit)
[![docs](https://push.rocks/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/smartgit/)

## Status for master
[![build status](https://gitlab.com/pushrocks/smartgit/badges/master/build.svg)](https://gitlab.com/pushrocks/smartgit/commits/master)
[![coverage report](https://gitlab.com/pushrocks/smartgit/badges/master/coverage.svg)](https://gitlab.com/pushrocks/smartgit/commits/master)
[![Dependency Status](https://david-dm.org/pushrocks/smartgit.svg)](https://david-dm.org/pushrocks/smartgit)
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/smartgit/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/smartgit/master/dependencies/npm)
[![bitHound Code](https://www.bithound.io/github/pushrocks/smartgit/badges/code.svg)](https://www.bithound.io/github/pushrocks/smartgit)
[![TypeScript](https://img.shields.io/badge/TypeScript-2.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%206.x.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)

## Usage
We recommend the use of TypeScript for best in class intellisense

```javascript
// import smartgit:
import { GitRepo } from 'smartgit'

// Initialize smartgit:
// -- note: there are 3 ways to initialize smartgit
// -- -- 1. with a existing Git repo
// -- -- 2. with a cloned Git repo
// -- -- 3. with a new Git repo

// -- 1. existing Git Repo:
let myExistingGitRepo = new GitRepo('/path/to/existing/git/repo/')

// -- 2. cloned Git Repo:
let myClonedGitRepo: GitRepo
smartgit.createRepoFromClone('git@github.com:username/reponame.git')
    .then(gitRepo => { // non blocking
        myClonedGitRepo = gitRepo
    })

// -- 3. new Git Repo
let myNewGitRepo: GitRepo
smartgit.createRepoFromInit('/path/to/new/folder') // smartgit will create any new folder, be careful
    .then(gitRepo => { // non blocking
        myNewGitRepo = gitRepo
    })

// Using smartgit instance
// -- most used actions
// -- all actions return promises, so make sure to use promise chaining for any dependent tasks
myExistingGitRepo.addAll() // returns promise, stages all changed files
myExistingGitRepo.add(['relative/path/to/file.txt','another/file2.txt']) // returns promise, stages specific files
myExistingGitRepo.commit('my commit message') // returns promise, commits staged files
myExistingGitRepo.status() // returns promise
    .then(status => { // Use TypeScript for status type information

    })
myExistingGitRepo.check() // returns promise, checks repo health
myExistingGitRepo.remoteAdd('git@github.com:username/reponame.git')
```

Tip: use [smartssh](https://npmjs.com/smartssh) to setup your SSH environment

[![npm](https://push.rocks/assets/repo-header.svg)](https://push.rocks)

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