easy-nodegit
A simple and elegant git client base on nodegit.
install
npm install easy-nodegit --save
Usage
Simple git client API, just like using git command:
const GitClient = require('easy-nodegit')
const client = new GitClient('/path/to/repo/work/directory', {
type: 'ssh',
privateKey: '/path/to/privateKey',
publicKey: '/path/to/publicKey'
username: '...',
password: '...'
})
async function test () {
await client.clone('git@github.com:yibn2008/easy-nodegit.git')
await client.add([
'index.js',
'index.css'
])
await client.add('lib/**/*.js')
await client.reset('index.*')
await client.remove('lib/modules/*')
await client.commit('commit message')
await client.pull()
await client.push()
}
test().catch(err => {
console.error(err)
})
API
see API.md
LICENSE
MIT