package
a high level wrapper for nodegit with simple and elegant API
npm install easy-nodegitGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
A simple and elegant git client base on nodegit.
npm install easy-nodegit --saveSimple git client API, just like using git command:
const GitClient = require('easy-nodegit')
const client = new GitClient('/path/to/repo/work/directory', {
type: 'ssh', // support 'ssh' or 'http', default is 'ssh'
// when type == 'ssh'
privateKey: '/path/to/privateKey', // default is ~/.ssh/id_rsa
publicKey: '/path/to/publicKey' // default is ~/.ssh/id_rsa.pub
// when type == 'http'
username: '...',
password: '...'
})
async function test () {
// clone
await client.clone('git@github.com:yibn2008/easy-nodegit.git')
// add
await client.add([
'index.js',
'index.css'
])
await client.add('lib/**/*.js')
// reset
await client.reset('index.*')
// remove
await client.remove('lib/modules/*')
// commit
await client.commit('commit message')
// pull
await client.pull()
// push
await client.push()
}
test().catch(err => {
console.error(err)
})see API.md
MIT
Estimated unpacked size across 46 packages.
34.9 MB
Includes dependencies.
4 direct · 3 outdated
^3.0.2
3.0.2
0.21.0
0.27.0
^1.0.1
2.0.0
^2.0.2
3.0.0