@keg-hub/git-lib

0.1.1 • Public • Published

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

Package Sidebar

Install

npm i @keg-hub/git-lib

Weekly Downloads

1

Version

0.1.1

License

MIT

Unpacked Size

37.5 kB

Total Files

33

Last publish

Collaborators

  • lktipton