@teambit/gitconfig

2.0.6 • Public • Published

gitconfig

Build Status Code Climate Code Coverage npm Version JS Standard

Run git config command.
Based on okunishinishi/node-gitconfig

Installation

npm install gitconfig --save

Usage

'use strict'

const gitconfig = require('@teambit/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) => {
  /* ... */
})

/**
 * @name getUrl
 * @description Get git remote name url or all remotes urls.
 * @param remoteName - string - remotname to fetch url
 * @return returns the remote names url if specified or all remote names urls if nothing is passed
 */
gitconfig.getUrl().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

Readme

Keywords

Package Sidebar

Install

npm i @teambit/gitconfig

Weekly Downloads

436

Version

2.0.6

License

MIT

Unpacked Size

76.1 kB

Total Files

30

Last publish

Collaborators

  • learn-bit
  • teambit-owner
  • shohamgilad
  • davidfirst
  • lalybar
  • ranm8
  • odedre
  • guysaar
  • itaymendel
  • erezbit
  • joshk2
  • redigma
  • yona007
  • jonisar
  • ocombe