soldair / node-gitconfiglocal

parse the .git/config file into a useful data structure

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status

gitconfiglocal

parse the .git/config file into a useful data structure

example

  • search config in $GIT_DIR (.git by default)
var gitconfig = require('gitconfiglocal');

gitconfig('./',function(err,config){
  console.log(config);
  /* prints:
  { core:
     { repositoryformatversion: '0',
       filemode: true,
       bare: false,
       logallrefupdates: true },
    remote:
     { origin:
        { url: 'git@github.com:soldair/node-gitconfiglocal.git',
          fetch: '+refs/heads/*:refs/remotes/origin/*' } } }
  */
});
  • specify $GIT_DIR via options:
gitconfig('./', { gitDir: 'path/to/gitdir' }, cb);

About

parse the .git/config file into a useful data structure

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:JavaScript 100.0%