Run git config command
npm install gitconfig --save
'use strict'
const gitconfig = require('gitconfig')
// Set git config values.
gitconfig.set({
'user.mail': '[email protected]'
}, {
location: 'local'
}).then(() => {
/* ... */
})
// Unset git config values.
gitconfig.unset([ 'user.mail' ], {
location: 'local'
}).then(() => {
/* ... */
})
// Git all config values.
gitconfig.get({
location: 'global'
}).then((config) => {
/* ... */
})
Signature | Description |
---|---|
gitconfig.get(options, callback) | Get all git config. |
gitconfig.get(key, options, callback) | Get config with key. |
gitconfig.set(key, val, options, callback) | Set a config value. |
gitconfig.set(values, options, callback) | Set mutliple config values. |
gitconfig.unset(keys, options, callback) | Un set config value(s). |
Name | Description |
---|---|
location | Config file location. (global, system, or local) |
This software is released under the MIT License.