0.1.1 • Published 2 years ago

@keg-hub/git-lib v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Git-Lib

Wrapper around the git command line executable

Install

With yarn

yarn add @keg-hub/git-lib

With npm

npm install @keg-hub/git-lib

Setup

  • Requires git to be installed, and on the $PATH

Example

// Beginning of your code
const { git } = require('@keg-hub/git-lib')

// ...Modify some files, save them, then...

// Add the changed files...
await git.add({
  files: [ '.' ],
  // Optional, uses process.cwd() when not passed
  root: `path/to/git/directory`,
})

// Commit the changed files...
await git.commit({
  message: `Changed some files`,
  // Optional, uses process.cwd() when not passed
  root: `path/to/git/directory`,
})

// Push the changed files...
await git.push({
  // Optional, uses the current working branch
  branch: `remote-branch-name`,
  // Optional, default is origin
  remote: 'upstream',
  // Optional, uses process.cwd() when not passed
  root: `path/to/git/directory`,
})

API

TODO