Skip to content

teambit/node-gitconfig

This branch is 2 commits ahead of okunishinishi/node-gitconfig:master.

Folders and files

NameName
Last commit message
Last commit date
Jul 30, 2016
Feb 22, 2016
May 8, 2016
Aug 23, 2018
Aug 23, 2018
May 8, 2016
May 8, 2016
Jul 22, 2018
Sep 15, 2015
Jul 23, 2018
Sep 15, 2015
Aug 23, 2018
Jan 13, 2025
Jan 13, 2025

Repository files navigation

gitconfig

Build Status Code Climate Code Coverage npm Version JS Standard

Run git config command

Installation

npm install gitconfig --save

Usage

'use strict'

const gitconfig = require('gitconfig')

// Set git config values.
gitconfig.set({
  'user.mail': 'foo@example.com'
}, {
  location: 'local'
}).then(() => {
  /* ... */
})

// Unset git config values.
gitconfig.unset([ 'user.mail' ], {
  location: 'local'
}).then(() => {
  /* ... */
})

// Git all config values.
gitconfig.get({
  location: 'global'
}).then((config) => {
  /* ... */
})

API

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).

Options

Name Description
location Config file location. (global, system, or local)

License

This software is released under the MIT License.

Links

About

Config git via node.js

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%